sync roster after setting pgp id. fixes #2991
This commit is contained in:
parent
511335179f
commit
2d5bd539db
|
@ -312,13 +312,16 @@ public class Contact implements ListItem, Blockable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPgpKeyId(long keyId) {
|
public boolean setPgpKeyId(long keyId) {
|
||||||
|
final long previousKeyId = getPgpKeyId();
|
||||||
synchronized (this.keys) {
|
synchronized (this.keys) {
|
||||||
try {
|
try {
|
||||||
this.keys.put("pgp_keyid", keyId);
|
this.keys.put("pgp_keyid", keyId);
|
||||||
|
return previousKeyId != keyId;
|
||||||
} catch (final JSONException ignored) {
|
} catch (final JSONException ignored) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOption(int option) {
|
public void setOption(int option) {
|
||||||
|
|
|
@ -311,7 +311,9 @@ public class PresenceParser extends AbstractParser implements
|
||||||
if (pgp != null && x != null) {
|
if (pgp != null && x != null) {
|
||||||
Element status = packet.findChild("status");
|
Element status = packet.findChild("status");
|
||||||
String msg = status != null ? status.getContent() : "";
|
String msg = status != null ? status.getContent() : "";
|
||||||
contact.setPgpKeyId(pgp.fetchKeyId(account, msg, x.getContent()));
|
if (contact.setPgpKeyId(pgp.fetchKeyId(account, msg, x.getContent()))) {
|
||||||
|
mXmppConnectionService.syncRoster(account);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
boolean online = sizeBefore < contact.getPresences().size();
|
boolean online = sizeBefore < contact.getPresences().size();
|
||||||
mXmppConnectionService.onContactStatusChanged.onContactStatusChanged(contact, online);
|
mXmppConnectionService.onContactStatusChanged.onContactStatusChanged(contact, online);
|
||||||
|
|
Loading…
Reference in New Issue