From 69a417b2f3187aa3d2583037f78cae4d08b8282c Mon Sep 17 00:00:00 2001 From: slotwin Date: Mon, 1 Dec 2014 21:34:43 +0000 Subject: Tlen: fixed handling of status message for offline contacts git-svn-id: http://svn.miranda-ng.org/main/trunk@11202 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tlen/src/tlen_presence.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'protocols/Tlen') diff --git a/protocols/Tlen/src/tlen_presence.cpp b/protocols/Tlen/src/tlen_presence.cpp index e36f859f65..60a77916a2 100644 --- a/protocols/Tlen/src/tlen_presence.cpp +++ b/protocols/Tlen/src/tlen_presence.cpp @@ -121,17 +121,19 @@ void TlenProcessPresence(XmlNode *node, TlenProtocol *proto) status = ID_STATUS_INVISIBLE; } p = TlenTextDecode(statusNode->text); - TlenListAddResource(proto, LIST_ROSTER, from, status, p); - if ((hContact=TlenHContactFromJID(proto, from)) != NULL) { - if (p != NULL && *p) { - char* statusMsg_utf8 = mir_utf8encode(p); - db_set_utf(hContact, "CList", "StatusMsg", statusMsg_utf8); - mir_free(statusMsg_utf8); - } else { - db_unset(hContact, "CList", "StatusMsg"); - } + } + else + p = NULL; + TlenListAddResource(proto, LIST_ROSTER, from, status, p); + if ((hContact=TlenHContactFromJID(proto, from)) != NULL) { + if (p != NULL && *p) { + char* statusMsg_utf8 = mir_utf8encode(p); + db_set_utf(hContact, "CList", "StatusMsg", statusMsg_utf8); + mir_free(statusMsg_utf8); + mir_free(p); + } else { + db_unset(hContact, "CList", "StatusMsg"); } - if (p) mir_free(p); } if ((item=TlenListGetItemPtr(proto, LIST_ROSTER, from)) != NULL) { // Determine status to show for the contact based on the remaining resources -- cgit v1.2.3