diff options
author | George Hazan <ghazan@miranda.im> | 2017-09-19 14:12:58 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-09-19 14:13:06 +0300 |
commit | e254312f9a660c83081ce2062ab14ba3c3614089 (patch) | |
tree | 324dff386c4b394ed4dc0f9b912ce3332bd94e84 /protocols/Twitter | |
parent | 54ad7c456325b4c7fd639ef2d7cca7d5aef81c05 (diff) |
useless structure GCDEST finally removed
Diffstat (limited to 'protocols/Twitter')
-rw-r--r-- | protocols/Twitter/src/chat.cpp | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/protocols/Twitter/src/chat.cpp b/protocols/Twitter/src/chat.cpp index 491ab50848..b323d0dbfc 100644 --- a/protocols/Twitter/src/chat.cpp +++ b/protocols/Twitter/src/chat.cpp @@ -24,9 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. void TwitterProto::UpdateChat(const twitter_user &update)
{
- GCDEST gcd = { m_szModuleName, m_tszUserName, GC_EVENT_MESSAGE };
- GCEVENT gce = { &gcd };
- gce.pDest = &gcd;
+ GCEVENT gce = { m_szModuleName, m_tszUserName, GC_EVENT_MESSAGE };
gce.bIsMe = (update.username == twit_.get_username());
gce.dwFlags = GCEF_ADDTOLOG;
gce.ptszUID = mir_a2u(update.username.c_str());
@@ -59,10 +57,10 @@ void TwitterProto::UpdateChat(const twitter_user &update) int TwitterProto::OnChatOutgoing(WPARAM, LPARAM lParam)
{
GCHOOK *hook = reinterpret_cast<GCHOOK*>(lParam);
- if (mir_strcmp(hook->pDest->pszModule, m_szModuleName))
+ if (mir_strcmp(hook->pszModule, m_szModuleName))
return 0;
- switch (hook->pDest->iType) {
+ switch (hook->iType) {
case GC_USER_MESSAGE:
debugLogW(L"**Chat - Outgoing message: %s", hook->ptszText);
{
@@ -90,28 +88,26 @@ int TwitterProto::OnChatOutgoing(WPARAM, LPARAM lParam) // TODO: remove nick?
void TwitterProto::AddChatContact(const char *name, const char *nick)
{
- GCDEST gcd = { m_szModuleName, m_tszUserName, GC_EVENT_JOIN };
- GCEVENT gce = { &gcd };
+ ptrW wszId(mir_a2u(name));
+ ptrW wszNick(mir_a2u(nick ? nick : name));
+
+ GCEVENT gce = { m_szModuleName, m_tszUserName, GC_EVENT_JOIN };
gce.time = DWORD(time(0));
- gce.ptszNick = mir_a2u(nick ? nick : name);
- gce.ptszUID = mir_a2u(name);
+ gce.ptszNick = wszNick;
+ gce.ptszUID = wszId;
gce.ptszStatus = L"Normal";
Chat_Event(&gce);
-
- mir_free(const_cast<wchar_t*>(gce.ptszNick));
- mir_free(const_cast<wchar_t*>(gce.ptszUID));
}
void TwitterProto::DeleteChatContact(const char *name)
{
- GCDEST gcd = { m_szModuleName, m_tszUserName, GC_EVENT_PART };
- GCEVENT gce = { &gcd };
+ ptrW wszId(mir_a2u(name));
+
+ GCEVENT gce = { m_szModuleName, m_tszUserName, GC_EVENT_PART };
gce.time = DWORD(time(0));
- gce.ptszNick = mir_a2u(name);
+ gce.ptszNick = wszId;
gce.ptszUID = gce.ptszNick;
Chat_Event(&gce);
-
- mir_free(const_cast<wchar_t*>(gce.ptszNick));
}
INT_PTR TwitterProto::OnJoinChat(WPARAM, LPARAM suppress)
|