Skip to content

Commit 300659e

Browse files
author
DrKLO
committed
Update to 2.6.0
Replies Mentions Hashtags New messages forward logic Blur in photo editor
1 parent 0f4b890 commit 300659e

File tree

166 files changed

+5692
-2225
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+5692
-2225
lines changed

TMessagesProj/build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ buildscript {
33
mavenCentral()
44
}
55
dependencies {
6-
classpath 'com.android.tools.build:gradle:1.1.0'
6+
classpath 'com.android.tools.build:gradle:1.1.3'
77
}
88
}
99
apply plugin: 'com.android.application'
@@ -13,16 +13,16 @@ repositories {
1313
}
1414

1515
dependencies {
16-
compile 'com.android.support:support-v4:21.0.+'
16+
compile 'com.android.support:support-v4:22.0.+'
1717
compile 'com.google.android.gms:play-services:3.2.+'
1818
compile 'net.hockeyapp.android:HockeySDK:3.5.+'
1919
compile 'com.googlecode.mp4parser:isoparser:1.0.+'
2020
compile 'com.android.support:recyclerview-v7:+'
2121
}
2222

2323
android {
24-
compileSdkVersion 21
25-
buildToolsVersion '21.1.2'
24+
compileSdkVersion 22
25+
buildToolsVersion '22.0.0'
2626

2727
compileOptions {
2828
sourceCompatibility JavaVersion.VERSION_1_7
@@ -81,8 +81,8 @@ android {
8181

8282
defaultConfig {
8383
minSdkVersion 8
84-
targetSdkVersion 21
85-
versionCode 458
86-
versionName "2.5.2"
84+
targetSdkVersion 22
85+
versionCode 466
86+
versionName "2.6.0"
8787
}
8888
}

TMessagesProj/src/main/java/jawnae/pyronet/PyroClientListener.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@
2222
import java.nio.ByteBuffer;
2323

2424
public interface PyroClientListener {
25-
public void connectedClient(PyroClient client);
25+
void connectedClient(PyroClient client);
2626

27-
public void unconnectableClient(PyroClient client, Exception cause);
27+
void unconnectableClient(PyroClient client, Exception cause);
2828

29-
public void droppedClient(PyroClient client, IOException cause);
29+
void droppedClient(PyroClient client, IOException cause);
3030

31-
public void disconnectedClient(PyroClient client);
31+
void disconnectedClient(PyroClient client);
3232

3333
//
3434

35-
public void receivedData(PyroClient client, ByteBuffer data);
35+
void receivedData(PyroClient client, ByteBuffer data);
3636

37-
public void sentData(PyroClient client, int bytes);
37+
void sentData(PyroClient client, int bytes);
3838
}

TMessagesProj/src/main/java/org/telegram/android/AndroidUtilities.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,6 @@ public static void showKeyboard(View view) {
169169
}
170170
InputMethodManager inputManager = (InputMethodManager)view.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
171171
inputManager.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);
172-
173-
((InputMethodManager) view.getContext().getSystemService(Context.INPUT_METHOD_SERVICE)).showSoftInput(view, 0);
174172
}
175173

176174
public static boolean isKeyboardShowed(View view) {

TMessagesProj/src/main/java/org/telegram/android/ImageReceiver.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929

3030
public class ImageReceiver implements NotificationCenter.NotificationCenterDelegate {
3131

32-
public static interface ImageReceiverDelegate {
33-
public void didSetImage(ImageReceiver imageReceiver, boolean set, boolean thumb);
32+
public interface ImageReceiverDelegate {
33+
void didSetImage(ImageReceiver imageReceiver, boolean set, boolean thumb);
3434
}
3535

3636
private View parentView;

TMessagesProj/src/main/java/org/telegram/android/MediaController.java

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
8787

8888
public static int[] readArgs = new int[3];
8989

90-
public static interface FileDownloadProgressListener {
91-
public void onFailedDownload(String fileName);
92-
public void onSuccessDownload(String fileName);
93-
public void onProgressDownload(String fileName, float progress);
94-
public void onProgressUpload(String fileName, float progress, boolean isEncrypted);
95-
public int getObserverTag();
90+
public interface FileDownloadProgressListener {
91+
void onFailedDownload(String fileName);
92+
void onSuccessDownload(String fileName);
93+
void onProgressDownload(String fileName, float progress);
94+
void onProgressUpload(String fileName, float progress, boolean isEncrypted);
95+
int getObserverTag();
9696
}
9797

9898
private class AudioBuffer {
@@ -234,6 +234,7 @@ public static class SearchImage {
234234
private long recordStartTime;
235235
private long recordTimeCount;
236236
private long recordDialogId;
237+
private MessageObject recordReplyingMessageObject;
237238
private DispatchQueue fileDecodingQueue;
238239
private DispatchQueue playerQueue;
239240
private ArrayList<AudioBuffer> usedPlayerBuffers = new ArrayList<>();
@@ -509,7 +510,7 @@ public void run() {
509510
lastProgress = progress;
510511
playingMessageObject.audioProgress = value;
511512
playingMessageObject.audioProgressSec = lastProgress / 1000;
512-
NotificationCenter.getInstance().postNotificationName(NotificationCenter.audioProgressDidChanged, playingMessageObject.messageOwner.id, value);
513+
NotificationCenter.getInstance().postNotificationName(NotificationCenter.audioProgressDidChanged, playingMessageObject.getId(), value);
513514
} catch (Exception e) {
514515
FileLog.e("tmessages", e);
515516
}
@@ -977,7 +978,7 @@ public void didReceivedNotification(int id, Object... args) {
977978
} else if (id == NotificationCenter.messagesDeleted) {
978979
if (playingMessageObject != null) {
979980
ArrayList<Integer> markAsDeletedMessages = (ArrayList<Integer>)args[0];
980-
if (markAsDeletedMessages.contains(playingMessageObject.messageOwner.id)) {
981+
if (markAsDeletedMessages.contains(playingMessageObject.getId())) {
981982
clenupPlayer(false);
982983
}
983984
}
@@ -1187,7 +1188,7 @@ private void clenupPlayer(boolean notify) {
11871188
playingMessageObject.audioProgressSec = 0;
11881189
playingMessageObject = null;
11891190
if (notify) {
1190-
NotificationCenter.getInstance().postNotificationName(NotificationCenter.audioDidReset, lastFile.messageOwner.id);
1191+
NotificationCenter.getInstance().postNotificationName(NotificationCenter.audioDidReset, lastFile.getId());
11911192
}
11921193
}
11931194
}
@@ -1227,7 +1228,7 @@ public void run() {
12271228
}
12281229

12291230
public boolean seekToProgress(MessageObject messageObject, float progress) {
1230-
if (audioTrackPlayer == null && audioPlayer == null || messageObject == null || playingMessageObject == null || playingMessageObject != null && playingMessageObject.messageOwner.id != messageObject.messageOwner.id) {
1231+
if (audioTrackPlayer == null && audioPlayer == null || messageObject == null || playingMessageObject == null || playingMessageObject != null && playingMessageObject.getId() != messageObject.getId()) {
12311232
return false;
12321233
}
12331234
try {
@@ -1249,7 +1250,7 @@ public boolean playAudio(MessageObject messageObject) {
12491250
if (messageObject == null) {
12501251
return false;
12511252
}
1252-
if ((audioTrackPlayer != null || audioPlayer != null) && playingMessageObject != null && messageObject.messageOwner.id == playingMessageObject.messageOwner.id) {
1253+
if ((audioTrackPlayer != null || audioPlayer != null) && playingMessageObject != null && messageObject.getId() == playingMessageObject.getId()) {
12531254
if (isPaused) {
12541255
resumeAudio(messageObject);
12551256
}
@@ -1412,7 +1413,7 @@ public void stopAudio() {
14121413

14131414
public boolean pauseAudio(MessageObject messageObject) {
14141415
stopProximitySensor();
1415-
if (audioTrackPlayer == null && audioPlayer == null || messageObject == null || playingMessageObject == null || playingMessageObject != null && playingMessageObject.messageOwner.id != messageObject.messageOwner.id) {
1416+
if (audioTrackPlayer == null && audioPlayer == null || messageObject == null || playingMessageObject == null || playingMessageObject != null && playingMessageObject.getId() != messageObject.getId()) {
14161417
return false;
14171418
}
14181419
try {
@@ -1432,7 +1433,7 @@ public boolean pauseAudio(MessageObject messageObject) {
14321433

14331434
public boolean resumeAudio(MessageObject messageObject) {
14341435
startProximitySensor();
1435-
if (audioTrackPlayer == null && audioPlayer == null || messageObject == null || playingMessageObject == null || playingMessageObject != null && playingMessageObject.messageOwner.id != messageObject.messageOwner.id) {
1436+
if (audioTrackPlayer == null && audioPlayer == null || messageObject == null || playingMessageObject == null || playingMessageObject != null && playingMessageObject.getId() != messageObject.getId()) {
14361437
return false;
14371438
}
14381439
try {
@@ -1451,14 +1452,14 @@ public boolean resumeAudio(MessageObject messageObject) {
14511452
}
14521453

14531454
public boolean isPlayingAudio(MessageObject messageObject) {
1454-
return !(audioTrackPlayer == null && audioPlayer == null || messageObject == null || playingMessageObject == null || playingMessageObject != null && playingMessageObject.messageOwner.id != messageObject.messageOwner.id);
1455+
return !(audioTrackPlayer == null && audioPlayer == null || messageObject == null || playingMessageObject == null || playingMessageObject != null && playingMessageObject.getId() != messageObject.getId());
14551456
}
14561457

14571458
public boolean isAudioPaused() {
14581459
return isPaused;
14591460
}
14601461

1461-
public void startRecording(final long dialog_id) {
1462+
public void startRecording(final long dialog_id, final MessageObject reply_to_msg) {
14621463
clenupPlayer(true);
14631464

14641465
try {
@@ -1505,6 +1506,7 @@ public void run() {
15051506
recordStartTime = System.currentTimeMillis();
15061507
recordTimeCount = 0;
15071508
recordDialogId = dialog_id;
1509+
recordReplyingMessageObject = reply_to_msg;
15081510
fileBuffer.rewind();
15091511

15101512
audioRecorder.startRecording();
@@ -1557,11 +1559,11 @@ public void run() {
15571559
long duration = recordTimeCount;
15581560
audioToSend.duration = (int) (duration / 1000);
15591561
if (duration > 700) {
1560-
SendMessagesHelper.getInstance().sendMessage(audioToSend, recordingAudioFileToSend.getAbsolutePath(), recordDialogId);
1562+
SendMessagesHelper.getInstance().sendMessage(audioToSend, recordingAudioFileToSend.getAbsolutePath(), recordDialogId, recordReplyingMessageObject);
1563+
NotificationCenter.getInstance().postNotificationName(NotificationCenter.audioDidSent);
15611564
} else {
15621565
recordingAudioFileToSend.delete();
15631566
}
1564-
NotificationCenter.getInstance().postNotificationName(NotificationCenter.audioDidSent);
15651567
}
15661568
});
15671569
}
@@ -1739,7 +1741,7 @@ public GifDrawable getGifDrawable(ChatMediaCell cell, boolean create) {
17391741
return null;
17401742
}
17411743

1742-
if (currentGifDrawable != null && currentGifMessageObject != null && messageObject.messageOwner.id == currentGifMessageObject.messageOwner.id) {
1744+
if (currentGifDrawable != null && currentGifMessageObject != null && messageObject.getId() == currentGifMessageObject.getId()) {
17431745
currentMediaCell = cell;
17441746
currentGifDrawable.parentView = new WeakReference<View>(cell);
17451747
return currentGifDrawable;
@@ -1788,7 +1790,7 @@ public void clearGifDrawable(ChatMediaCell cell) {
17881790
return;
17891791
}
17901792

1791-
if (currentGifMessageObject != null && messageObject.messageOwner.id == currentGifMessageObject.messageOwner.id) {
1793+
if (currentGifMessageObject != null && messageObject.getId() == currentGifMessageObject.getId()) {
17921794
if (currentGifDrawable != null) {
17931795
currentGifDrawable.stop();
17941796
currentGifDrawable.recycle();

0 commit comments

Comments
 (0)