summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_util.cpp
diff options
context:
space:
mode:
authordartraiden <wowemuh@gmail.com>2019-07-21 19:59:18 +0300
committerdartraiden <wowemuh@gmail.com>2019-07-21 19:59:18 +0300
commitb078dfb78c89aea87cd422eae52694738e473cf3 (patch)
treeca896e82a8a5ce81f80d041f4aee7fdeeb007162 /protocols/JabberG/src/jabber_util.cpp
parentee7e29d02e94e969c1154515cd0c408c591a2414 (diff)
Restore "Free for chat" status support (fixes #1963)
Diffstat (limited to 'protocols/JabberG/src/jabber_util.cpp')
-rwxr-xr-xprotocols/JabberG/src/jabber_util.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp
index db99565983..87b69204e7 100755
--- a/protocols/JabberG/src/jabber_util.cpp
+++ b/protocols/JabberG/src/jabber_util.cpp
@@ -197,6 +197,7 @@ void JabberHttpUrlDecode(wchar_t *str)
int JabberCombineStatus(int status1, int status2)
{
// Combine according to the following priority (high to low)
+ // ID_STATUS_FREECHAT
// ID_STATUS_ONLINE
// ID_STATUS_DND
// ID_STATUS_AWAY
@@ -204,6 +205,8 @@ int JabberCombineStatus(int status1, int status2)
// ID_STATUS_INVISIBLE (valid only for TLEN_PLUGIN)
// ID_STATUS_OFFLINE
// other ID_STATUS in random order (actually return status1)
+ if (status1 == ID_STATUS_FREECHAT || status2 == ID_STATUS_FREECHAT)
+ return ID_STATUS_FREECHAT;
if (status1 == ID_STATUS_ONLINE || status2 == ID_STATUS_ONLINE)
return ID_STATUS_ONLINE;
if (status1 == ID_STATUS_DND || status2 == ID_STATUS_DND)
@@ -475,6 +478,10 @@ void CJabberProto::SendPresenceTo(int status, const char *to, const TiXmlElement
p << XCHILD("show", "dnd");
if (!msg) msg = m_modeMsgs.szDnd;
break;
+ case ID_STATUS_FREECHAT:
+ p << XCHILD("show", "chat");
+ if (!msg) msg = m_modeMsgs.szFreechat;
+ break;
default: // Should not reach here
break;
}