Use start/stop lifecycle callbacks rather than pause/resume.

Also fixed a couple of bugs.
This commit is contained in:
akwizgran
2016-10-12 16:55:00 +01:00
parent b3e5d1ff85
commit 50a70f7649
51 changed files with 563 additions and 538 deletions

View File

@@ -102,10 +102,11 @@ class MessagingManagerImpl extends ConversationClientImpl
boolean local = meta.getBoolean("local");
boolean read = meta.getBoolean(MSG_KEY_READ);
PrivateMessageHeader header = new PrivateMessageHeader(
m.getId(), m.getGroupId(), timestamp, contentType, local, read,
m.getId(), groupId, timestamp, contentType, local, read,
false, false);
ContactId contactId = getContactId(txn, groupId);
PrivateMessageReceivedEvent event = new PrivateMessageReceivedEvent(
header, groupId);
header, contactId, groupId);
txn.attach(event);
trackIncomingMessage(txn, m);
@@ -133,6 +134,17 @@ class MessagingManagerImpl extends ConversationClientImpl
}
}
private ContactId getContactId(Transaction txn, GroupId g)
throws DbException {
try {
BdfDictionary meta =
clientHelper.getGroupMetadataAsDictionary(txn, g);
return new ContactId(meta.getLong("contactId").intValue());
} catch (FormatException e) {
throw new DbException(e);
}
}
@Override
public ContactId getContactId(GroupId g) throws DbException {
try {