mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-17 21:29:54 +01:00
Use start/stop lifecycle callbacks rather than pause/resume.
Also fixed a couple of bugs.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user