mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-28 11:42:15 -05:00
use new 'api' to add messages to a conversation
This commit is contained in:
parent
c9238ef5ae
commit
44f9022d95
@ -529,7 +529,7 @@ public class XmppConnectionService extends Service {
|
|||||||
return connection;
|
return connection;
|
||||||
}
|
}
|
||||||
|
|
||||||
synchronized public void sendMessage(Message message) {
|
public void sendMessage(Message message) {
|
||||||
Account account = message.getConversation().getAccount();
|
Account account = message.getConversation().getAccount();
|
||||||
account.deactivateGracePeriod();
|
account.deactivateGracePeriod();
|
||||||
Conversation conv = message.getConversation();
|
Conversation conv = message.getConversation();
|
||||||
@ -615,7 +615,7 @@ public class XmppConnectionService extends Service {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
conv.getMessages().add(message);
|
conv.add(message);
|
||||||
if (saveInDb) {
|
if (saveInDb) {
|
||||||
if (message.getEncryption() == Message.ENCRYPTION_NONE
|
if (message.getEncryption() == Message.ENCRYPTION_NONE
|
||||||
|| saveEncryptedMessages()) {
|
|| saveEncryptedMessages()) {
|
||||||
@ -881,7 +881,7 @@ public class XmppConnectionService extends Service {
|
|||||||
for (Message message : messages) {
|
for (Message message : messages) {
|
||||||
message.setConversation(conversation);
|
message.setConversation(conversation);
|
||||||
}
|
}
|
||||||
conversation.getMessages().addAll(0, messages);
|
conversation.addAll(0, messages);
|
||||||
return messages.size();
|
return messages.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user