summaryrefslogtreecommitdiff
path: root/protocols/Icq10/src/proto.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Icq10/src/proto.cpp')
-rw-r--r--protocols/Icq10/src/proto.cpp18
1 files changed, 17 insertions, 1 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)