diff options
author | George Hazan <ghazan@miranda.im> | 2019-03-14 15:33:56 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-03-14 15:33:56 +0300 |
commit | 2084ac854656d90a030de560d69d6c5080f9bb00 (patch) | |
tree | 7aee488af4be9ab91dbe2e0c14da9e6ae681ed07 | |
parent | 045d56c1e28bef568aaf619346cdd3417469e786 (diff) |
Jabber: fixes status message calculation for the case of single resource present
-rwxr-xr-x | protocols/JabberG/src/jabber_proto.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 7e0fad12dc..1cf32c5b5a 100755 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -1134,10 +1134,17 @@ void __cdecl CJabberProto::GetAwayMsgThread(void *param) JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, jid);
if (item != nullptr) {
if (item->arResources.getCount() > 0) {
- CMStringA str;
+ int nRes = 0;
+ CMStringA str, strLast;
for (auto &r : item->arResources)
- if (r->m_szStatusMessage)
+ if (r->m_szStatusMessage) {
+ nRes++;
+ strLast = r->m_szStatusMessage;
str.AppendFormat("(%s): %s\r\n", r->m_szResourceName, r->m_szStatusMessage);
+ }
+
+ if (nRes == 1)
+ str = strLast;
str.TrimRight();
ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, Utf2T(str));
|