From 15c49e3fc4cf033fffbf79e9f68a0405d5a95d14 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 26 Sep 2019 22:15:57 +0300 Subject: Clist_IsHidden / Clist_HideContact - two helpers to hide CList/Hidden variable and unify access to it --- protocols/EmLanProto/src/mlan.cpp | 8 ++++---- protocols/EmLanProto/src/stdafx.h | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'protocols/EmLanProto') diff --git a/protocols/EmLanProto/src/mlan.cpp b/protocols/EmLanProto/src/mlan.cpp index 6ad76e2f95..27a3d9508e 100644 --- a/protocols/EmLanProto/src/mlan.cpp +++ b/protocols/EmLanProto/src/mlan.cpp @@ -207,7 +207,7 @@ MCONTACT CMLan::FindContact(in_addr addr, const char *nick, bool add_to_list, bo if (make_permanent) db_unset(res, "CList", "NotOnList"); if (make_visible) - db_unset(res, "CList", "Hidden"); + Clist_HideContact(res, false); return res; } } @@ -221,7 +221,7 @@ MCONTACT CMLan::FindContact(in_addr addr, const char *nick, bool add_to_list, bo if (!make_permanent) db_set_b(res, "CList", "NotOnList", 1); if (!make_visible) - db_set_b(res, "CList", "Hidden", 1); + Clist_HideContact(res); g_plugin.setWord(res, "Status", status); return res; @@ -340,7 +340,7 @@ void CMLan::OnRecvPacket(u_char *mes, int len, in_addr from) void CMLan::RecvMessageUrl(CCSDATA *ccs) { - db_unset(ccs->hContact, "CList", "Hidden"); + Clist_HideContact(ccs->hContact, false); PROTORECVEVENT *pre = (PROTORECVEVENT*)ccs->lParam; ptrA szMessage(mir_utf8encode(pre->szMessage)); @@ -924,7 +924,7 @@ void CMLan::RecvFile(CCSDATA *ccs) { PROTORECVEVENT *pre = (PROTORECVEVENT *)ccs->lParam; - db_unset(ccs->hContact, "CList", "Hidden"); + Clist_HideContact(ccs->hContact, false); char *szFile = pre->szMessage + sizeof(DWORD); char *szDesc = szFile + mir_strlen(szFile) + 1; diff --git a/protocols/EmLanProto/src/stdafx.h b/protocols/EmLanProto/src/stdafx.h index 5da73a09ee..550e2dfaf3 100644 --- a/protocols/EmLanProto/src/stdafx.h +++ b/protocols/EmLanProto/src/stdafx.h @@ -16,6 +16,7 @@ #include #include #include +#include #include "resource.h" #include "version.h" -- cgit v1.2.3