From 24da6586bfdb3e41cc8240e41162b016e10b68c3 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 28 Apr 2025 15:21:18 +0300 Subject: =?UTF-8?q?fixes=20#4998=20(=D0=92=20=D0=BE=D0=BA=D0=BD=D0=B5=20?= =?UTF-8?q?=D1=81=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8=D0=B9=20Dummy-?= =?UTF-8?q?=D0=BA=D0=BE=D0=BD=D1=82=D0=B0=D0=BA=D1=82=D0=B0=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=BB=D0=B5=20=D0=B2=D0=B2=D0=BE=D0=B4=D0=B0=20=D1=82=D0=B5?= =?UTF-8?q?=D0=BA=D1=81=D1=82=D0=B0=20=D0=BD=D0=B5=20=D0=BE=D1=82=D0=BA?= =?UTF-8?q?=D0=BB=D1=8E=D1=87=D0=B5=D0=BD=D0=BE)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/Dummy/src/dummy_proto.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'protocols/Dummy/src/dummy_proto.cpp') diff --git a/protocols/Dummy/src/dummy_proto.cpp b/protocols/Dummy/src/dummy_proto.cpp index 295872252a..db82416df5 100644 --- a/protocols/Dummy/src/dummy_proto.cpp +++ b/protocols/Dummy/src/dummy_proto.cpp @@ -81,7 +81,8 @@ static int sttCompareProtocols(const CDummyProto *p1, const CDummyProto *p2) } CDummyProto::CDummyProto(const char *szModuleName, const wchar_t *ptszUserName) : - PROTO(szModuleName, ptszUserName) + PROTO(szModuleName, ptszUserName), + bAllowSending(szModuleName, "AllowSending", false) { msgid = 0; @@ -139,7 +140,7 @@ INT_PTR CDummyProto::GetCaps(int type, MCONTACT) { switch(type) { case PFLAGNUM_1: - return PF1_IM | PF1_BASICSEARCH | PF1_ADDSEARCHRES; + return PF1_BASICSEARCH | PF1_ADDSEARCHRES | (bAllowSending ? PF1_IM : 0); case PFLAGNUM_4: return PF4_AVATARS | PF4_NOAUTHDENYREASON | PF4_NOCUSTOMAUTH; @@ -191,7 +192,7 @@ int CDummyProto::SendMsg(MCONTACT hContact, MEVENT, const char *msg) std::string message = msg; unsigned int id = InterlockedIncrement(&msgid); - if (getByte(DUMMY_KEY_ALLOW_SENDING, 0)) + if (bAllowSending) ProtoBroadcastAsync(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)id); else ProtoBroadcastAsync(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)id, (LPARAM)TranslateT("This Dummy account has disabled sending messages. Enable it in account options.")); -- cgit v1.2.3