mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Cleanup.
This commit is contained in:
@@ -32,7 +32,7 @@ public class AutoMessageReplyReceiver extends BroadcastReceiver {
|
||||
if (dialog_id == 0 || max_id == 0) {
|
||||
return;
|
||||
}
|
||||
SendMessagesHelper.getInstance().sendMessageText(text.toString(), dialog_id, null, null, true, null, null, null);
|
||||
SendMessagesHelper.getInstance().sendMessageText(text.toString(), dialog_id, null, null, true, null, null);
|
||||
MessagesController.getInstance().markDialogAsRead(dialog_id, max_id, max_id, 0, true, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2697,7 +2697,7 @@ public class MediaController implements AudioManager.OnAudioFocusChangeListener,
|
||||
audioToSend.attributes.add(attributeAudio);
|
||||
if (duration > 700) {
|
||||
if (send == 1) {
|
||||
SendMessagesHelper.getInstance().sendMessageDocument(audioToSend, null, recordingAudioFileToSend.getAbsolutePath(), recordDialogId, recordReplyingMessageObject, null, null);
|
||||
SendMessagesHelper.getInstance().sendMessageDocument(audioToSend, null, recordingAudioFileToSend.getAbsolutePath(), recordDialogId, recordReplyingMessageObject, null);
|
||||
}
|
||||
NotificationCenter.getInstance().postNotificationName(NotificationCenter.audioDidSent, send == 2 ? audioToSend : null, send == 2 ? recordingAudioFileToSend.getAbsolutePath() : null);
|
||||
} else {
|
||||
|
||||
@@ -471,7 +471,7 @@ public class MessageObject {
|
||||
|
||||
public void setType() {
|
||||
int oldType = type;
|
||||
if (messageOwner instanceof TLRPC.TL_message || messageOwner instanceof TLRPC.TL_messageForwarded_old2) {
|
||||
if (messageOwner instanceof TLRPC.TL_message /*|| messageOwner instanceof TLRPC.TL_messageForwarded_old2*/) {
|
||||
if (isMediaEmpty()) {
|
||||
type = 0;
|
||||
if (messageText == null || messageText.length() == 0) {
|
||||
@@ -910,9 +910,9 @@ public class MessageObject {
|
||||
|
||||
boolean useManualParse = !hasEntities && (
|
||||
messageOwner instanceof TLRPC.TL_message_old ||
|
||||
messageOwner instanceof TLRPC.TL_message_old2 ||
|
||||
messageOwner instanceof TLRPC.TL_message_old3 ||
|
||||
messageOwner instanceof TLRPC.TL_message_old4 ||
|
||||
//messageOwner instanceof TLRPC.TL_message_old2 ||
|
||||
//messageOwner instanceof TLRPC.TL_message_old3 ||
|
||||
//messageOwner instanceof TLRPC.TL_message_old4 ||
|
||||
messageOwner instanceof TLRPC.TL_messageForwarded_old ||
|
||||
messageOwner instanceof TLRPC.TL_messageForwarded_old2 ||
|
||||
messageOwner instanceof TLRPC.TL_message_secret ||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -690,7 +690,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
SendMessagesHelper.getInstance().sendMessageDocument((TLRPC.TL_document) document, null, null, peer, replyingMessageObject, null, null);
|
||||
SendMessagesHelper.getInstance().sendMessageDocument((TLRPC.TL_document) document, null, null, peer, replyingMessageObject, null);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1042,31 +1042,31 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
|
||||
}
|
||||
*/
|
||||
|
||||
public void sendMessageContact(TLRPC.User user, long peer, MessageObject reply_to_msg, TLRPC.ReplyMarkup replyMarkup, HashMap<String, String> params) {
|
||||
public void sendMessageContact(TLRPC.User user, long peer, MessageObject reply_to_msg, HashMap<String, String> params) {
|
||||
sendMessage__(null, null, null, null, user, null, peer, null, reply_to_msg, null, true,
|
||||
null, replyMarkup, params);
|
||||
null, null, params);
|
||||
}
|
||||
|
||||
public void sendMessageDocument(TLRPC.TL_document document, VideoEditedInfo videoEditedInfo, String path, long peer, MessageObject reply_to_msg, TLRPC.ReplyMarkup replyMarkup, HashMap<String, String> params) {
|
||||
public void sendMessageDocument(TLRPC.TL_document document, VideoEditedInfo videoEditedInfo, String path, long peer, MessageObject reply_to_msg, HashMap<String, String> params) {
|
||||
sendMessage__(null, null, null, videoEditedInfo, null, document, peer, path, reply_to_msg, null, true,
|
||||
null, replyMarkup, params);
|
||||
null, null, params);
|
||||
}
|
||||
|
||||
public void sendMessageText(String message, long peer, MessageObject reply_to_msg, TLRPC.WebPage webPage, boolean searchLinks, ArrayList<TLRPC.MessageEntity> entities, TLRPC.ReplyMarkup replyMarkup, HashMap<String, String> params) {
|
||||
public void sendMessageText(String message, long peer, MessageObject reply_to_msg, TLRPC.WebPage webPage, boolean searchLinks, ArrayList<TLRPC.MessageEntity> entities, HashMap<String, String> params) {
|
||||
sendMessage__(message, null, null, null, null, null, peer, null, reply_to_msg, webPage, searchLinks,
|
||||
entities, replyMarkup, params);
|
||||
entities, null, params);
|
||||
}
|
||||
|
||||
/*
|
||||
public void sendMessageLocation(TLRPC.MessageMedia location, long peer, MessageObject reply_to_msg, TLRPC.ReplyMarkup replyMarkup, HashMap<String, String> params) {
|
||||
public void sendMessageLocation(TLRPC.MessageMedia location, long peer, MessageObject reply_to_msg, HashMap<String, String> params) {
|
||||
sendMessage__(null, location, null, null, null, null, peer, null, reply_to_msg, null, true, null,
|
||||
replyMarkup, params);
|
||||
null, params);
|
||||
}
|
||||
*/
|
||||
|
||||
public void sendMessagePhoto(TLRPC.TL_photo photo, String path, long peer, MessageObject reply_to_msg, TLRPC.ReplyMarkup replyMarkup, HashMap<String, String> params) {
|
||||
public void sendMessagePhoto(TLRPC.TL_photo photo, String path, long peer, MessageObject reply_to_msg, HashMap<String, String> params) {
|
||||
sendMessage__(null, null, photo, null, null, null, peer, path, reply_to_msg, null, true, null,
|
||||
replyMarkup, params);
|
||||
null, params);
|
||||
}
|
||||
|
||||
private void sendMessage__(String message,
|
||||
@@ -1081,7 +1081,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
|
||||
TLRPC.WebPage webPage,
|
||||
boolean searchLinks,
|
||||
ArrayList<TLRPC.MessageEntity> entities,
|
||||
TLRPC.ReplyMarkup replyMarkup,
|
||||
Object replyMarkup,
|
||||
HashMap<String, String> params) {
|
||||
if (peer == 0) { // peer == dialog id
|
||||
return;
|
||||
@@ -1283,10 +1283,10 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
|
||||
newMsg.flags |= TLRPC.MESSAGE_FLAG_REPLY;
|
||||
newMsg.reply_to_msg_id = reply_to_msg.getId();
|
||||
}
|
||||
if (replyMarkup != null /*&& encryptedChat == null*/) {
|
||||
/*if (replyMarkup != null && encryptedChat == null) {
|
||||
newMsg.flags |= TLRPC.MESSAGE_FLAG_HAS_MARKUP;
|
||||
newMsg.reply_markup = replyMarkup;
|
||||
}
|
||||
}*/
|
||||
if (lower_id != 0) {
|
||||
/*if (high_id == 1) {
|
||||
if (currentChatInfo == null) {
|
||||
@@ -2173,7 +2173,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
|
||||
AndroidUtilities.runOnUIThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
SendMessagesHelper.getInstance().sendMessageDocument(documentFinal, null, pathFinal, dialog_id, reply_to_msg, null, params);
|
||||
SendMessagesHelper.getInstance().sendMessageDocument(documentFinal, null, pathFinal, dialog_id, reply_to_msg, params);
|
||||
}
|
||||
});
|
||||
return true;
|
||||
@@ -2246,7 +2246,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
|
||||
AndroidUtilities.runOnUIThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
SendMessagesHelper.getInstance().sendMessageDocument(documentFinal, null, messageObject.messageOwner.attachPath, dialog_id, reply_to_msg, null, params);
|
||||
SendMessagesHelper.getInstance().sendMessageDocument(documentFinal, null, messageObject.messageOwner.attachPath, dialog_id, reply_to_msg, params);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2408,7 +2408,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
|
||||
AndroidUtilities.runOnUIThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
SendMessagesHelper.getInstance().sendMessageDocument(documentFinal, null, pathFinal, dialog_id, reply_to_msg, null, params);
|
||||
SendMessagesHelper.getInstance().sendMessageDocument(documentFinal, null, pathFinal, dialog_id, reply_to_msg, params);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@@ -2458,7 +2458,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
|
||||
AndroidUtilities.runOnUIThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
SendMessagesHelper.getInstance().sendMessagePhoto(photoFinal, needDownloadHttpFinal ? searchImage.imageUrl : null, dialog_id, reply_to_msg, null, params);
|
||||
SendMessagesHelper.getInstance().sendMessagePhoto(photoFinal, needDownloadHttpFinal ? searchImage.imageUrl : null, dialog_id, reply_to_msg, params);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2499,7 +2499,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
|
||||
//int count = (int) Math.ceil(textFinal.length() / 4096.0f);
|
||||
//for (int a = 0; a < count; a++) {
|
||||
// String mess = textFinal.substring(a * 4096, Math.min((a + 1) * 4096, textFinal.length()));
|
||||
SendMessagesHelper.getInstance().sendMessageText(textFinal, dialog_id, null, null, true, null, null, null);
|
||||
SendMessagesHelper.getInstance().sendMessageText(textFinal, dialog_id, null, null, true, null, null);
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -2610,7 +2610,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
|
||||
AndroidUtilities.runOnUIThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
SendMessagesHelper.getInstance().sendMessagePhoto(photoFinal, null, dialog_id, reply_to_msg, null, params);
|
||||
SendMessagesHelper.getInstance().sendMessagePhoto(photoFinal, null, dialog_id, reply_to_msg, params);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2739,7 +2739,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
|
||||
AndroidUtilities.runOnUIThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
SendMessagesHelper.getInstance().sendMessageDocument(videoFinal, videoEditedInfo, finalPath, dialog_id, reply_to_msg, null, params);
|
||||
SendMessagesHelper.getInstance().sendMessageDocument(videoFinal, videoEditedInfo, finalPath, dialog_id, reply_to_msg, params);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -32,7 +32,7 @@ public class WearReplyReceiver extends BroadcastReceiver {
|
||||
if (dialog_id == 0 || max_id == 0) {
|
||||
return;
|
||||
}
|
||||
SendMessagesHelper.getInstance().sendMessageText(text.toString(), dialog_id, null, null, true, null, null, null);
|
||||
SendMessagesHelper.getInstance().sendMessageText(text.toString(), dialog_id, null, null, true, null, null);
|
||||
MessagesController.getInstance().markDialogAsRead(dialog_id, max_id, max_id, 0, true, false);
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4618,7 +4618,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
user.first_name = name;
|
||||
user.last_name = "";
|
||||
user.phone = number;
|
||||
SendMessagesHelper.getInstance().sendMessageContact(user, dialog_id, replyingMessageObject, null, null);
|
||||
SendMessagesHelper.getInstance().sendMessageContact(user, dialog_id, replyingMessageObject, null);
|
||||
}
|
||||
if (sent) {
|
||||
showReplyPanel(false, null, null, null, false, true);
|
||||
@@ -5196,7 +5196,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
//}
|
||||
}
|
||||
} else if (inlineReturn != 0) {
|
||||
if (messageObject.messageOwner.reply_markup != null) {
|
||||
/*if (messageObject.messageOwner.reply_markup != null) {
|
||||
for (int b = 0; b < messageObject.messageOwner.reply_markup.rows.size(); b++) {
|
||||
TLRPC.TL_keyboardButtonRow row = messageObject.messageOwner.reply_markup.rows.get(b);
|
||||
for (int c = 0; c < row.buttons.size(); c++) {
|
||||
@@ -5207,7 +5207,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1346,7 +1346,7 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
|
||||
if (playing != null && playing == audioToSendMessageObject) {
|
||||
MediaController.getInstance().cleanupPlayer(true, true);
|
||||
}
|
||||
SendMessagesHelper.getInstance().sendMessageDocument(audioToSend, null, audioToSendPath, dialog_id, replyingMessageObject, null, null);
|
||||
SendMessagesHelper.getInstance().sendMessageDocument(audioToSend, null, audioToSendPath, dialog_id, replyingMessageObject, null);
|
||||
if (delegate != null) {
|
||||
delegate.onMessageSend(null);
|
||||
}
|
||||
@@ -1389,7 +1389,7 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
|
||||
//int count = (int) Math.ceil(text.length() / 4096.0f);
|
||||
//for (int a = 0; a < count; a++) {
|
||||
// CharSequence mess = text.subSequence(a * 4096, Math.min((a + 1) * 4096, text.length()));
|
||||
SendMessagesHelper.getInstance().sendMessageText(text.toString(), dialog_id, replyingMessageObject, messageWebPage, messageWebPageSearch, MessagesQuery.getEntities(text), null, null);
|
||||
SendMessagesHelper.getInstance().sendMessageText(text.toString(), dialog_id, replyingMessageObject, messageWebPage, messageWebPageSearch, MessagesQuery.getEntities(text), null);
|
||||
//}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1445,7 +1445,7 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
|
||||
}
|
||||
if (contactsToSend != null && !contactsToSend.isEmpty()) {
|
||||
for (TLRPC.User user : contactsToSend) {
|
||||
SendMessagesHelper.getInstance().sendMessageContact(user, dialog_id, null, null, null);
|
||||
SendMessagesHelper.getInstance().sendMessageContact(user, dialog_id, null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2281,7 +2281,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||
presentFragment(new ChatActivity(args), true);
|
||||
removeSelfFromStack();
|
||||
TLRPC.User user = MessagesController.getInstance().getUser(user_id);
|
||||
SendMessagesHelper.getInstance().sendMessageContact(user, dialog_id, null, null, null);
|
||||
SendMessagesHelper.getInstance().sendMessageContact(user, dialog_id, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user