aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/services/XmppConnectionService.java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2014-05-18 13:23:26 +0200
committerDaniel Gultsch <daniel@gultsch.de>2014-05-18 13:23:26 +0200
commite857cf979d719d18b0d0a858413ceeb0a4ef5305 (patch)
tree2e44733ceda61751390c991d73609c429ea23b8a /src/eu/siacs/conversations/services/XmppConnectionService.java
parent7fc7201abbef6b8532eaa35b1f896eb216e6b0eb (diff)
fixed #123 fixed122
Diffstat (limited to 'src/eu/siacs/conversations/services/XmppConnectionService.java')
-rw-r--r--src/eu/siacs/conversations/services/XmppConnectionService.java23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java
index e5ed6a55..3a02b40e 100644
--- a/src/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/eu/siacs/conversations/services/XmppConnectionService.java
@@ -726,11 +726,10 @@ public class XmppConnectionService extends Service {
@Override
public void onBind(Account account) {
- databaseBackend.clearPresences(account);
+ databaseBackend.clearPresences(account); //contact presences
account.clearPresences(); // self presences
- if (account.getXmppConnection().hasFeatureRosterManagment()) {
- updateRoster(account, null);
- }
+ updateRoster(account, null);
+ sendPresence(account);
connectMultiModeConversations(account);
if (convChangedListener != null) {
convChangedListener.onConversationListChanged();
@@ -1389,16 +1388,15 @@ public class XmppConnectionService extends Service {
contact.getAccount().getXmppConnection().sendPresencePacket(packet);
}
- public void sendPgpPresence(Account account, String signature) {
+ public void sendPresence(Account account) {
PresencePacket packet = new PresencePacket();
packet.setAttribute("from", account.getFullJid());
- Element status = new Element("status");
- status.setContent("online");
- packet.addChild(status);
- Element x = new Element("x");
- x.setAttribute("xmlns", "jabber:x:signed");
- x.setContent(signature);
- packet.addChild(x);
+ String sig = account.getPgpSignature();
+ if (sig!=null) {
+ packet.addChild("status").setContent("online");
+ packet.addChild("x","jabber:x:signed").setContent(sig);
+ }
+ Log.d(LOGTAG,packet.toString());
account.getXmppConnection().sendPresencePacket(packet);
}
@@ -1422,7 +1420,6 @@ public class XmppConnectionService extends Service {
this.tlsException = null;
}
- // TODO dont let thread sleep but schedule wake up
public void reconnectAccount(final Account account, final boolean force) {
new Thread(new Runnable() {