summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-01-10 23:34:33 +0200
committerGeorge Hazan <ghazan@miranda.im>2019-01-10 23:34:33 +0200
commit6a668c99fcd6549b3b17085a738a93fdd5eb9719 (patch)
tree4d359eff60323c9b8a18813be9448a161125e359 /protocols
parent1ec1b0f4686fcd220aecc28f7ec77036b55c43af (diff)
ICQ10: send private messages in group chats
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Icq10/src/proto.cpp18
-rw-r--r--protocols/Icq10/src/proto.h4
2 files changed, 20 insertions, 2 deletions
diff --git a/protocols/Icq10/src/proto.cpp b/protocols/Icq10/src/proto.cpp
index 67c1ae8c9c..978bf847dc 100644
--- a/protocols/Icq10/src/proto.cpp
+++ b/protocols/Icq10/src/proto.cpp
@@ -160,7 +160,7 @@ int CIcqProto::GroupchatEventHook(WPARAM, LPARAM lParam)
break;
case GC_USER_PRIVMESS:
- // Chat_SendPrivateMessage(gch);
+ SendPrivateMessage(gch);
break;
case GC_USER_LOGMENU:
@@ -174,6 +174,22 @@ int CIcqProto::GroupchatEventHook(WPARAM, LPARAM lParam)
return 0;
}
+void CIcqProto::SendPrivateMessage(GCHOOK *gch)
+{
+ MCONTACT hContact;
+ DWORD dwUin = _wtoi(gch->ptszUID);
+ auto *pCache = FindContactByUIN(dwUin);
+ if (pCache == nullptr) {
+ hContact = CreateContact(dwUin, true);
+ setWString(hContact, "Nick", gch->ptszNick);
+ db_set_b(hContact, "CList", "Hidden", 1);
+ db_set_dw(hContact, "Ignore", "Mask1", 0);
+ }
+ else hContact = pCache->m_hContact;
+
+ CallService(MS_MSG_SENDMESSAGE, hContact, 0);
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
void CIcqProto::MarkReadTimerProc(HWND hwnd, UINT, UINT_PTR id, DWORD)
diff --git a/protocols/Icq10/src/proto.h b/protocols/Icq10/src/proto.h
index 6d350a7275..a0fe63fa96 100644
--- a/protocols/Icq10/src/proto.h
+++ b/protocols/Icq10/src/proto.h
@@ -85,7 +85,6 @@ class CIcqProto : public PROTO<CIcqProto>
void CheckPassword(void);
void ConnectionFailed(int iReason);
CMStringA GetUserId(MCONTACT);
- void LoadChatInfo(SESSION_INFO*);
MCONTACT ParseBuddyInfo(const JSONNode &buddy, MCONTACT hContact = -1);
void ParseMessage(MCONTACT hContact, __int64 &lastMsgId, const JSONNode &msg);
void RetrieveUserHistory(MCONTACT, __int64 startMsgId, __int64 endMsgId);
@@ -97,6 +96,9 @@ class CIcqProto : public PROTO<CIcqProto>
void OnLoggedIn(void);
void OnLoggedOut(void);
+ void LoadChatInfo(SESSION_INFO *si);
+ void SendPrivateMessage(GCHOOK *gch);
+
mir_cs csMarkReadQueue;
LIST<IcqCacheItem> arMarkReadQueue;
static void CALLBACK MarkReadTimerProc(HWND hwnd, UINT, UINT_PTR id, DWORD);