diff options
Diffstat (limited to 'protocols/Discord/src/utils.cpp')
-rw-r--r-- | protocols/Discord/src/utils.cpp | 8 |
1 files 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)); } ///////////////////////////////////////////////////////////////////////////////////////// |