diff options
author | George Hazan <george.hazan@gmail.com> | 2016-09-17 16:37:24 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-09-17 16:37:24 +0000 |
commit | e5d58fc3bbbce2773b7c6c3f8b7da6faa66b672e (patch) | |
tree | 6432409a59b53d8098ac38aa1d3072ae2e5f9e4b /plugins/MirLua | |
parent | 17e345e621254103a98bbc7e662a2829b7aa3ce6 (diff) |
chats: more functions, less structures
git-svn-id: http://svn.miranda-ng.org/main/trunk@17309 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua')
-rw-r--r-- | plugins/MirLua/src/m_message.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/plugins/MirLua/src/m_message.cpp b/plugins/MirLua/src/m_message.cpp index cc0de69657..d08fad864b 100644 --- a/plugins/MirLua/src/m_message.cpp +++ b/plugins/MirLua/src/m_message.cpp @@ -34,18 +34,10 @@ static int message_Send(lua_State *L) const char *szProto = GetContactProto(hContact);
if (db_get_b(hContact, szProto, "ChatRoom", 0) == TRUE)
{
- ptrW tszChatRoom(db_get_wsa(hContact, szProto, "ChatRoomID"));
- GCDEST gcd = { szProto, tszChatRoom, GC_EVENT_SENDMESSAGE };
- GCEVENT gce = { sizeof(gce), &gcd };
- gce.bIsMe = TRUE;
- gce.dwFlags = GCEF_ADDTOLOG;
- gce.ptszText = mir_utf8decodeW(message);
- gce.time = time(NULL);
-
- res = Chat_Event(WINDOW_VISIBLE, &gce);
+ ptrW wszChatRoom(db_get_wsa(hContact, szProto, "ChatRoomID"));
+ ptrW wszMessage(mir_utf8decodeW(message));
+ res = Chat_SendUserMessage(szProto, wszChatRoom, wszMessage);
lua_pushinteger(L, res);
-
- mir_free((void*)gce.ptszText);
}
else if ((res = ProtoChainSend(hContact, PSS_MESSAGE, 0, (LPARAM)message)) != ACKRESULT_FAILED)
{
|