From 5f97f4c8be447b9c083fb4f37e6093e939bb54e8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 27 Sep 2017 21:09:52 +0300 Subject: fixes #944 ( [Discord] Recent change breaks clist behavior (no longer displaying topics in contact list) --- protocols/Discord/src/utils.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/protocols/Discord/src/utils.cpp b/protocols/Discord/src/utils.cpp index 2c8deddc32..b60e03df6b 100644 --- a/protocols/Discord/src/utils.cpp +++ b/protocols/Discord/src/utils.cpp @@ -134,12 +134,16 @@ SnowFlake CDiscordProto::getId(MCONTACT hContact, const char *szSetting) void CDiscordProto::setId(const char *szSetting, SnowFlake iValue) { - db_set_blob(0, m_szModuleName, szSetting, &iValue, sizeof(iValue)); + SnowFlake oldVal = getId(szSetting); + if (oldVal != iValue) + db_set_blob(0, m_szModuleName, szSetting, &iValue, sizeof(iValue)); } void CDiscordProto::setId(MCONTACT hContact, const char *szSetting, SnowFlake iValue) { - db_set_blob(hContact, m_szModuleName, szSetting, &iValue, sizeof(iValue)); + SnowFlake oldVal = getId(hContact, szSetting); + if (oldVal != iValue) + db_set_blob(hContact, m_szModuleName, szSetting, &iValue, sizeof(iValue)); } ///////////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3