summaryrefslogtreecommitdiff
path: root/protocols/Twitter
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-09-16 19:43:24 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-09-16 19:43:24 +0000
commit0c41e6c4566fdb2d99b8a6ca1fb48859fd4a0e34 (patch)
tree700937499ee66952d1ca5b92928fc9ec3b034447 /protocols/Twitter
parent7a7a6637021d78ad995f3e21e9743fae69bd2562 (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/Twitter')
-rw-r--r--protocols/Twitter/src/chat.cpp20
-rw-r--r--protocols/Twitter/src/proto.cpp2
2 files changed, 11 insertions, 11 deletions
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<LPARAM>(&gce));
+ Chat_Event(0, &gce);
mir_free(const_cast<wchar_t*>(gce.ptszNick));
mir_free(const_cast<wchar_t*>(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<LPARAM>(&gce));
+ Chat_Event(0, &gce);
mir_free(const_cast<wchar_t*>(gce.ptszNick));
mir_free(const_cast<wchar_t*>(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<LPARAM>(&gce));
+ Chat_Event(0, &gce);
mir_free(const_cast<wchar_t*>(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<LPARAM>(&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<LPARAM>(&gce));
- CallServiceSync(MS_GC_EVENT, SESSION_TERMINATE, reinterpret_cast<LPARAM>(&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<LPARAM>(&gce));
- CallServiceSync(MS_GC_EVENT, SESSION_ONLINE, reinterpret_cast<LPARAM>(&gce));
+ Chat_Event(SESSION_INITDONE, &gce);
+ Chat_Event(SESSION_ONLINE, &gce);
}
else
- CallServiceSync(MS_GC_EVENT, SESSION_OFFLINE, reinterpret_cast<LPARAM>(&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<LPARAM>(&gcr));
+ Chat_Register(&gcr);
DBEVENTTYPEDESCR evt = { sizeof(evt) };
evt.eventType = TWITTER_DB_EVENT_TYPE_TWEET;