From e5d58fc3bbbce2773b7c6c3f8b7da6faa66b672e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 17 Sep 2016 16:37:24 +0000 Subject: chats: more functions, less structures git-svn-id: http://svn.miranda-ng.org/main/trunk@17309 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirLua/src/m_message.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'plugins/MirLua') 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) { -- cgit v1.2.3