From 29af90eb23768e9eb2c29091fefaaa10c78ff8cd Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 14 Oct 2024 16:16:07 +0300 Subject: more code cleaning --- plugins/Scriver/src/msgdialog.cpp | 6 +++--- plugins/TabSRMM/src/msgdlgother.cpp | 4 ++-- protocols/JabberG/src/jabber_util.cpp | 2 +- src/core/stdmsg/src/msgdialog.cpp | 4 ++-- src/core/stdmsg/src/tabs.cpp | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 1241496857..602aeaeb0e 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -857,7 +857,7 @@ INT_PTR CMsgDialog::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) if (isChat()) { if (m_si->wState & STATE_TALK) { m_si->wState &= ~STATE_TALK; - db_set_w(m_hContact, m_si->pszModule, "ApparentMode", 0); + db_unset(m_hContact, m_si->pszModule, "ApparentMode"); } if (m_si->wState & GC_EVENT_HIGHLIGHT) { @@ -882,8 +882,8 @@ INT_PTR CMsgDialog::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) SetFocus(m_message.GetHwnd()); if (isChat()) { - if (db_get_w(m_hContact, m_si->pszModule, "ApparentMode", 0) != 0) - db_set_w(m_hContact, m_si->pszModule, "ApparentMode", 0); + if (db_get_w(m_hContact, m_si->pszModule, "ApparentMode") != 0) + db_unset(m_hContact, m_si->pszModule, "ApparentMode"); if (Clist_GetEvent(m_hContact, 0)) Clist_RemoveEvent(m_hContact, GC_FAKE_EVENT); } diff --git a/plugins/TabSRMM/src/msgdlgother.cpp b/plugins/TabSRMM/src/msgdlgother.cpp index ff4214d1c2..982ab1cdcb 100644 --- a/plugins/TabSRMM/src/msgdlgother.cpp +++ b/plugins/TabSRMM/src/msgdlgother.cpp @@ -2590,8 +2590,8 @@ void CMsgDialog::UpdateWindowState(UINT msg) if (m_si) { m_hTabIcon = m_hTabStatusIcon; - if (db_get_w(m_si->hContact, m_si->pszModule, "ApparentMode", 0) != 0) - db_set_w(m_si->hContact, m_si->pszModule, "ApparentMode", 0); + if (db_get_w(m_si->hContact, m_si->pszModule, "ApparentMode") != 0) + db_unset(m_si->hContact, m_si->pszModule, "ApparentMode"); if (Clist_GetEvent(m_si->hContact, 0)) Clist_RemoveEvent(m_si->hContact, GC_FAKE_EVENT); diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index 1f750bc08c..43fa76a620 100644 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -378,7 +378,7 @@ void CJabberProto::SendVisibleInvisiblePresence(bool invisible) if (hContact == 0) continue; - uint16_t apparentMode = getWord(hContact, "ApparentMode", 0); + uint16_t apparentMode = getWord(hContact, "ApparentMode"); if (invisible && apparentMode == ID_STATUS_OFFLINE) m_ThreadInfo->send(XmlNode("presence") << XATTR("to", item->jid) << XATTR("type", "invisible")); else if (!invisible && apparentMode == ID_STATUS_ONLINE) diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 3a41cf431d..a57d9444a8 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -254,8 +254,8 @@ void CMsgDialog::OnActivate() if (isChat()) { UpdateStatusBar(); - if (db_get_w(m_hContact, m_si->pszModule, "ApparentMode", 0) != 0) - db_set_w(m_hContact, m_si->pszModule, "ApparentMode", 0); + if (db_get_w(m_hContact, m_si->pszModule, "ApparentMode") != 0) + db_unset(m_hContact, m_si->pszModule, "ApparentMode"); if (Clist_GetEvent(m_hContact, 0)) Clist_RemoveEvent(m_hContact, GC_FAKE_EVENT); } diff --git a/src/core/stdmsg/src/tabs.cpp b/src/core/stdmsg/src/tabs.cpp index 0fc587e3e5..52e54f4cd1 100644 --- a/src/core/stdmsg/src/tabs.cpp +++ b/src/core/stdmsg/src/tabs.cpp @@ -469,7 +469,7 @@ void CTabbedWindow::TabClicked() if (si) { if (si->wState & STATE_TALK) { si->wState &= ~STATE_TALK; - db_set_w(si->hContact, si->pszModule, "ApparentMode", 0); + db_unset(si->hContact, si->pszModule, "ApparentMode"); } if (si->wState & GC_EVENT_HIGHLIGHT) { -- cgit v1.2.3