summaryrefslogtreecommitdiff
path: root/protocols/Discord/src/utils.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-02-17 21:59:55 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-02-17 21:59:55 +0300
commit6f59b014a145d4bc7b6ec3e21f11a63af019d481 (patch)
treeabbfa1d946b7e42747c050018cc2c6f0efdcd5f3 /protocols/Discord/src/utils.cpp
parent864bb725fe2bb200853244a766a96b5aab86eb7e (diff)
Discord: fix to close chats on going offline
Diffstat (limited to 'protocols/Discord/src/utils.cpp')
-rw-r--r--protocols/Discord/src/utils.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/protocols/Discord/src/utils.cpp b/protocols/Discord/src/utils.cpp
index 40911369d2..4747afd2a9 100644
--- a/protocols/Discord/src/utils.cpp
+++ b/protocols/Discord/src/utils.cpp
@@ -19,9 +19,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
void CDiscordProto::SetAllContactStatuses(int status)
{
- for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
+ for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
if (!getByte(hContact, "ChatRoom"))
setWord(hContact, "Status", (WORD)status);
+ else if (status == ID_STATUS_OFFLINE)
+ Chat_Control(m_szModuleName, ptrW(getWStringA(hContact, "ChatRoomID")), SESSION_TERMINATE);
+ }
}
int StrToStatus(const CMStringW &str)