diff options
author | George Hazan <george.hazan@gmail.com> | 2016-09-16 19:43:24 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-09-16 19:43:24 +0000 |
commit | 0c41e6c4566fdb2d99b8a6ca1fb48859fd4a0e34 (patch) | |
tree | 700937499ee66952d1ca5b92928fc9ec3b034447 /protocols/FacebookRM | |
parent | 7a7a6637021d78ad995f3e21e9743fae69bd2562 (diff) |
- 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
Diffstat (limited to 'protocols/FacebookRM')
-rw-r--r-- | protocols/FacebookRM/src/chat.cpp | 36 | ||||
-rw-r--r-- | protocols/FacebookRM/src/proto.cpp | 4 |
2 files changed, 20 insertions, 20 deletions
diff --git a/protocols/FacebookRM/src/chat.cpp b/protocols/FacebookRM/src/chat.cpp index a41fed1c54..b487f4a2e1 100644 --- a/protocols/FacebookRM/src/chat.cpp +++ b/protocols/FacebookRM/src/chat.cpp @@ -48,7 +48,7 @@ void FacebookProto::UpdateChat(const char *chat_id, const char *id, const char * } gce.ptszNick = tnick; gce.ptszUID = tid; - CallServiceSync(MS_GC_EVENT, 0, reinterpret_cast<LPARAM>(&gce)); + Chat_Event(0, &gce); facy.erase_reader(ChatIDToHContact(chat_id)); } @@ -61,7 +61,7 @@ void FacebookProto::RenameChat(const char *chat_id, const char *name) GCDEST gcd = { m_szModuleName, tchat_id, GC_EVENT_CHANGESESSIONAME }; GCEVENT gce = { sizeof(gce), &gcd }; gce.ptszText = tname; - CallService(MS_GC_EVENT, 0, reinterpret_cast<LPARAM>(&gce)); + Chat_Event(0, &gce); } int FacebookProto::OnGCEvent(WPARAM, LPARAM lParam) @@ -199,7 +199,7 @@ void FacebookProto::AddChatContact(const char *chat_id, const chatroom_participa } } - CallServiceSync(MS_GC_EVENT, 0, reinterpret_cast<LPARAM>(&gce)); + Chat_Event(0, &gce); } void FacebookProto::RemoveChatContact(const char *chat_id, const char *id, const char *name) @@ -220,7 +220,7 @@ void FacebookProto::RemoveChatContact(const char *chat_id, const char *id, const gce.time = ::time(NULL); gce.bIsMe = false; - CallServiceSync(MS_GC_EVENT, 0, reinterpret_cast<LPARAM>(&gce)); + Chat_Event(0, &gce); } /** Caller must free result */ @@ -232,7 +232,7 @@ char *FacebookProto::GetChatUsers(const char *chat_id) gci.Flags = GCF_USERS; gci.pszModule = m_szModuleName; gci.pszID = ptszChatID; - CallService(MS_GC_GETINFO, 0, (LPARAM)&gci); + Chat_GetInfo(&gci); // mir_free(gci.pszUsers); return gci.pszUsers; @@ -254,7 +254,7 @@ void FacebookProto::AddChat(const char *id, const wchar_t *tname) gcw.ptszID = tid; gcw.pszModule = m_szModuleName; gcw.ptszName = tname; - CallServiceSync(MS_GC_NEWSESSION, 0, (LPARAM)&gcw); + Chat_NewSession(&gcw); // Send setting events GCDEST gcd = { m_szModuleName, tid, GC_EVENT_ADDGROUP }; @@ -262,13 +262,13 @@ void FacebookProto::AddChat(const char *id, const wchar_t *tname) // Create a user statuses gce.ptszStatus = TranslateT("Myself"); - CallServiceSync(MS_GC_EVENT, NULL, reinterpret_cast<LPARAM>(&gce)); + Chat_Event(NULL, &gce); gce.ptszStatus = TranslateT("Friend"); - CallServiceSync(MS_GC_EVENT, NULL, reinterpret_cast<LPARAM>(&gce)); + Chat_Event(NULL, &gce); gce.ptszStatus = TranslateT("User"); - CallServiceSync(MS_GC_EVENT, NULL, reinterpret_cast<LPARAM>(&gce)); + Chat_Event(NULL, &gce); gce.ptszStatus = TranslateT("Former"); - CallServiceSync(MS_GC_EVENT, NULL, reinterpret_cast<LPARAM>(&gce)); + Chat_Event(NULL, &gce); // Finish initialization gcd.iType = GC_EVENT_CONTROL; @@ -276,8 +276,8 @@ void FacebookProto::AddChat(const char *id, const wchar_t *tname) gce.pDest = &gcd; bool hideChats = getBool(FACEBOOK_KEY_HIDE_CHATS, DEFAULT_HIDE_CHATS); - CallServiceSync(MS_GC_EVENT, (hideChats ? WINDOW_HIDDEN : SESSION_INITDONE), reinterpret_cast<LPARAM>(&gce)); - CallServiceSync(MS_GC_EVENT, SESSION_ONLINE, reinterpret_cast<LPARAM>(&gce)); + Chat_Event((hideChats ? WINDOW_HIDDEN : SESSION_INITDONE), &gce); + Chat_Event(SESSION_ONLINE, &gce); } INT_PTR FacebookProto::OnJoinChat(WPARAM hContact, LPARAM) @@ -346,8 +346,8 @@ INT_PTR FacebookProto::OnLeaveChat(WPARAM wParam, LPARAM) GCEVENT gce = { sizeof(gce), &gcd }; gce.time = ::time(NULL); - CallServiceSync(MS_GC_EVENT, SESSION_OFFLINE, reinterpret_cast<LPARAM>(&gce)); - CallServiceSync(MS_GC_EVENT, SESSION_TERMINATE, reinterpret_cast<LPARAM>(&gce)); + Chat_Event(SESSION_OFFLINE, &gce); + Chat_Event(SESSION_TERMINATE, &gce); if (!wParam) { facy.clear_chatrooms(); @@ -438,15 +438,15 @@ void FacebookProto::PrepareNotificationsChatRoom() { gcw.ptszID = _A2W(FACEBOOK_NOTIFICATIONS_CHATROOM); gcw.pszModule = m_szModuleName; gcw.ptszName = nameT; - CallServiceSync(MS_GC_NEWSESSION, 0, (LPARAM)&gcw); + Chat_NewSession(&gcw); // Send setting events GCDEST gcd = { m_szModuleName, _A2W(FACEBOOK_NOTIFICATIONS_CHATROOM), GC_EVENT_CONTROL }; GCEVENT gce = { sizeof(gce), &gcd }; gce.time = ::time(NULL); - CallServiceSync(MS_GC_EVENT, WINDOW_HIDDEN, reinterpret_cast<LPARAM>(&gce)); - CallServiceSync(MS_GC_EVENT, SESSION_ONLINE, reinterpret_cast<LPARAM>(&gce)); + Chat_Event(WINDOW_HIDDEN, &gce); + Chat_Event(SESSION_ONLINE, &gce); } } @@ -472,5 +472,5 @@ void FacebookProto::UpdateNotificationsChatRoom(facebook_notification *notificat gce.ptszNick = TranslateT("Notifications"); gce.ptszUID = idT; - CallServiceSync(MS_GC_EVENT, 0, reinterpret_cast<LPARAM>(&gce)); + Chat_Event(0, &gce); }
\ No newline at end of file diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp index aac1821f0e..38a0c958b1 100644 --- a/protocols/FacebookRM/src/proto.cpp +++ b/protocols/FacebookRM/src/proto.cpp @@ -489,7 +489,7 @@ int FacebookProto::OnModulesLoaded(WPARAM, LPARAM) gcr.iMaxText = FACEBOOK_MESSAGE_LIMIT; gcr.nColors = 0; gcr.pColors = NULL; - CallService(MS_GC_REGISTER, 0, reinterpret_cast<LPARAM>(&gcr)); + Chat_Register(&gcr); return 0; } @@ -750,7 +750,7 @@ INT_PTR FacebookProto::VisitNotifications(WPARAM, LPARAM) if (useChatRoom) { GCDEST gcd = { m_szModuleName, _T(FACEBOOK_NOTIFICATIONS_CHATROOM), GC_EVENT_CONTROL }; GCEVENT gce = { sizeof(gce), &gcd }; - CallServiceSync(MS_GC_EVENT, WINDOW_VISIBLE, reinterpret_cast<LPARAM>(&gce)); + Chat_Event(WINDOW_VISIBLE, &gce); } else {*/ OpenUrl(FACEBOOK_URL_NOTIFICATIONS); |