diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2014-03-11 16:27:33 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2014-03-11 16:27:33 +0100 |
commit | 838270432f5f4fbbdcc98ac7019c7baa4b666210 (patch) | |
tree | 0aab933ea44048f5b724462420fd2aa46903716e /src/eu/siacs/conversations/xmpp/XmppConnection.java | |
parent | 0d516b060354f577ff52ce2d3bb73f56557b87d1 (diff) |
cleaner/better logging
Diffstat (limited to '')
-rw-r--r-- | src/eu/siacs/conversations/xmpp/XmppConnection.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/eu/siacs/conversations/xmpp/XmppConnection.java b/src/eu/siacs/conversations/xmpp/XmppConnection.java index 6d5d4c46..b11f2016 100644 --- a/src/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/eu/siacs/conversations/xmpp/XmppConnection.java @@ -95,14 +95,16 @@ public class XmppConnection implements Runnable { } protected void changeStatus(int nextStatus) { - account.setStatus(nextStatus); - if (statusListener != null) { - statusListener.onStatusChanged(account); + if (account.getStatus() != nextStatus) { + account.setStatus(nextStatus); + if (statusListener != null) { + statusListener.onStatusChanged(account); + } } } protected void connect() { - Log.d(LOGTAG, "connecting"); + Log.d(LOGTAG,account.getJid()+ ": connecting"); try { tagReader = new XmlReader(wakeLock); tagWriter = new TagWriter(); @@ -165,7 +167,6 @@ public class XmppConnection implements Runnable { @Override public void run() { connect(); - Log.d(LOGTAG, "end run"); } private void processStream(Tag currentTag) throws XmlPullParserException, @@ -598,10 +599,10 @@ public class XmppConnection implements Runnable { public void sendPing() { if (streamFeatures.hasChild("sm")) { - Log.d(LOGTAG,"sending r as ping"); + Log.d(LOGTAG,account.getJid()+": sending r as ping"); tagWriter.writeStanzaAsync(new RequestPacket()); } else { - Log.d(LOGTAG,"sending iq as ping"); + Log.d(LOGTAG,account.getJid()+": sending iq as ping"); IqPacket iq = new IqPacket(IqPacket.TYPE_GET); Element ping = new Element("ping"); iq.setAttribute("from",account.getFullJid()); |