From 0c41e6c4566fdb2d99b8a6ca1fb48859fd4a0e34 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 16 Sep 2016 19:43:24 +0000 Subject: - chats services replaces with functions; - chat calls switched from CallServiceSync to direct calls everywhere git-svn-id: http://svn.miranda-ng.org/main/trunk@17305 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Twitter/src/chat.cpp | 20 ++++++++++---------- protocols/Twitter/src/proto.cpp | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'protocols/Twitter/src') diff --git a/protocols/Twitter/src/chat.cpp b/protocols/Twitter/src/chat.cpp index 0daee31258..61575672ca 100644 --- a/protocols/Twitter/src/chat.cpp +++ b/protocols/Twitter/src/chat.cpp @@ -49,7 +49,7 @@ void TwitterProto::UpdateChat(const twitter_user &update) else gce.ptszNick = mir_a2u(update.username.c_str()); - CallServiceSync(MS_GC_EVENT, 0, reinterpret_cast(&gce)); + Chat_Event(0, &gce); mir_free(const_cast(gce.ptszNick)); mir_free(const_cast(gce.ptszUID)); @@ -96,7 +96,7 @@ void TwitterProto::AddChatContact(const char *name, const char *nick) gce.ptszNick = mir_a2u(nick ? nick : name); gce.ptszUID = mir_a2u(name); gce.ptszStatus = L"Normal"; - CallServiceSync(MS_GC_EVENT, 0, reinterpret_cast(&gce)); + Chat_Event(0, &gce); mir_free(const_cast(gce.ptszNick)); mir_free(const_cast(gce.ptszUID)); @@ -109,7 +109,7 @@ void TwitterProto::DeleteChatContact(const char *name) gce.time = DWORD(time(0)); gce.ptszNick = mir_a2u(name); gce.ptszUID = gce.ptszNick; - CallServiceSync(MS_GC_EVENT, 0, reinterpret_cast(&gce)); + Chat_Event(0, &gce); mir_free(const_cast(gce.ptszNick)); } @@ -122,7 +122,7 @@ INT_PTR TwitterProto::OnJoinChat(WPARAM, LPARAM suppress) gcw.pszModule = m_szModuleName; gcw.ptszName = m_tszUserName; gcw.ptszID = m_tszUserName; - CallServiceSync(MS_GC_NEWSESSION, 0, (LPARAM)&gcw); + Chat_NewSession(&gcw); if (m_iStatus != ID_STATUS_ONLINE) return 0; @@ -131,7 +131,7 @@ INT_PTR TwitterProto::OnJoinChat(WPARAM, LPARAM suppress) GCDEST gcd = { m_szModuleName, m_tszUserName, GC_EVENT_ADDGROUP }; GCEVENT gce = { sizeof(gce), &gcd }; gce.ptszStatus = L"Normal"; - CallServiceSync(MS_GC_EVENT, 0, reinterpret_cast(&gce)); + Chat_Event(0, &gce); // ***** Hook events HookProtoEvent(ME_GC_EVENT, &TwitterProto::OnChatOutgoing); @@ -151,8 +151,8 @@ INT_PTR TwitterProto::OnLeaveChat(WPARAM, LPARAM) GCDEST gcd = { m_szModuleName, m_tszUserName, GC_EVENT_CONTROL }; GCEVENT gce = { sizeof(gce), &gcd }; - CallServiceSync(MS_GC_EVENT, SESSION_OFFLINE, reinterpret_cast(&gce)); - CallServiceSync(MS_GC_EVENT, SESSION_TERMINATE, reinterpret_cast(&gce)); + Chat_Event(SESSION_OFFLINE, &gce); + Chat_Event(SESSION_TERMINATE, &gce); return 0; } @@ -183,9 +183,9 @@ void TwitterProto::SetChatStatus(int status) // For some reason, I have to send an INITDONE message, even if I'm not actually // initializing the room... - CallServiceSync(MS_GC_EVENT, SESSION_INITDONE, reinterpret_cast(&gce)); - CallServiceSync(MS_GC_EVENT, SESSION_ONLINE, reinterpret_cast(&gce)); + Chat_Event(SESSION_INITDONE, &gce); + Chat_Event(SESSION_ONLINE, &gce); } else - CallServiceSync(MS_GC_EVENT, SESSION_OFFLINE, reinterpret_cast(&gce)); + Chat_Event(SESSION_OFFLINE, &gce); } diff --git a/protocols/Twitter/src/proto.cpp b/protocols/Twitter/src/proto.cpp index f44f1ce6b4..b2f43800db 100644 --- a/protocols/Twitter/src/proto.cpp +++ b/protocols/Twitter/src/proto.cpp @@ -341,7 +341,7 @@ int TwitterProto::OnModulesLoaded(WPARAM, LPARAM) gcr.pszModule = m_szModuleName; gcr.ptszDispName = m_tszUserName; gcr.iMaxText = 159; - CallService(MS_GC_REGISTER, 0, reinterpret_cast(&gcr)); + Chat_Register(&gcr); DBEVENTTYPEDESCR evt = { sizeof(evt) }; evt.eventType = TWITTER_DB_EVENT_TYPE_TWEET; -- cgit v1.2.3