From 2084ac854656d90a030de560d69d6c5080f9bb00 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 14 Mar 2019 15:33:56 +0300 Subject: Jabber: fixes status message calculation for the case of single resource present --- protocols/JabberG/src/jabber_proto.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'protocols') 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)); -- cgit v1.2.3