diff options
author | George Hazan <george.hazan@gmail.com> | 2013-06-15 18:26:30 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-06-15 18:26:30 +0000 |
commit | 2704f1deabc2fc0f0d8a59afbe5a63847d2ba8bd (patch) | |
tree | b8d80a80d20cd5020d7aa29f2f57ca5337f30eb0 | |
parent | 683c656dd87e82ec9e2d05f72a7b7e1c7269bfd6 (diff) |
ProtoBroadcastAck - unified helper for all protocols
git-svn-id: http://svn.miranda-ng.org/main/trunk@4963 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | protocols/WhatsApp/src/connection.cpp | 10 | ||||
-rw-r--r-- | protocols/WhatsApp/src/contacts.cpp | 4 | ||||
-rw-r--r-- | protocols/WhatsApp/src/messages.cpp | 10 |
3 files changed, 12 insertions, 12 deletions
diff --git a/protocols/WhatsApp/src/connection.cpp b/protocols/WhatsApp/src/connection.cpp index 39cbf96e54..76c2808d12 100644 --- a/protocols/WhatsApp/src/connection.cpp +++ b/protocols/WhatsApp/src/connection.cpp @@ -14,7 +14,7 @@ void WhatsAppProto::ChangeStatus(void*) {
this->connection->sendAvailableForChat();
m_iStatus = ID_STATUS_ONLINE;
- ProtoBroadcastAck(m_szModuleName, 0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) m_iStatus, ID_STATUS_INVISIBLE);
+ ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) m_iStatus, ID_STATUS_INVISIBLE);
}
}
else if (m_iStatus == ID_STATUS_ONLINE && m_iDesiredStatus == ID_STATUS_INVISIBLE)
@@ -24,7 +24,7 @@ void WhatsAppProto::ChangeStatus(void*) this->connection->sendClose();
m_iStatus = ID_STATUS_INVISIBLE;
SetAllContactStatuses( ID_STATUS_OFFLINE, true );
- ProtoBroadcastAck(m_szModuleName, 0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) m_iStatus, ID_STATUS_ONLINE);
+ ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) m_iStatus, ID_STATUS_ONLINE);
}
}
else if (m_iDesiredStatus == ID_STATUS_OFFLINE)
@@ -133,13 +133,13 @@ void WhatsAppProto::stayConnectedLoop(void*) this->ToggleStatusMenuItems(false);
int prevStatus = this->m_iStatus;
this->m_iStatus = ID_STATUS_OFFLINE;
- ProtoBroadcastAck(m_szModuleName, 0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) m_iStatus, prevStatus);
+ ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) m_iStatus, prevStatus);
break;
}
LOG("Connecting...");
this->m_iStatus = ID_STATUS_CONNECTING;
- ProtoBroadcastAck(m_szModuleName, 0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) ID_STATUS_OFFLINE, m_iStatus);
+ ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) ID_STATUS_OFFLINE, m_iStatus);
CODE_BLOCK_TRY
@@ -171,7 +171,7 @@ void WhatsAppProto::stayConnectedLoop(void*) LOG("Set status to online");
this->m_iStatus = desiredStatus;
- ProtoBroadcastAck(m_szModuleName, 0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE )m_iStatus, ID_STATUS_CONNECTING);
+ ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE )m_iStatus, ID_STATUS_CONNECTING);
this->ToggleStatusMenuItems(true);
ForkThread(&WhatsAppProto::ProcessBuddyList, this);
diff --git a/protocols/WhatsApp/src/contacts.cpp b/protocols/WhatsApp/src/contacts.cpp index 8e5861efb6..1f942362dd 100644 --- a/protocols/WhatsApp/src/contacts.cpp +++ b/protocols/WhatsApp/src/contacts.cpp @@ -272,7 +272,7 @@ void WhatsAppProto::onLastSeen(const std::string& paramString1, int paramInt, st isr.firstName = "";
isr.lastName = "";
isr.email = "";
- ProtoBroadcastAck(m_szModuleName, NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, targ, (LPARAM)&isr);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, targ, (LPARAM)&isr);
// #TODO
}
*/
@@ -348,7 +348,7 @@ void WhatsAppProto::onSendGetPicture(const std::string& jid, const std::vector<u {
ackResult = ACKRESULT_FAILED;
}
- ProtoBroadcastAck(m_szModuleName, ai.hContact, ACKTYPE_AVATAR, ackResult, (HANDLE)&ai, 0);
+ ProtoBroadcastAck(ai.hContact, ACKTYPE_AVATAR, ackResult, (HANDLE)&ai, 0);
}
}
diff --git a/protocols/WhatsApp/src/messages.cpp b/protocols/WhatsApp/src/messages.cpp index c05e19de83..d45d3ec2d9 100644 --- a/protocols/WhatsApp/src/messages.cpp +++ b/protocols/WhatsApp/src/messages.cpp @@ -62,7 +62,7 @@ void WhatsAppProto::SendMsgWorker(void* p) db_get_b(data->hContact, m_szModuleName, "IsGroupMember", 0) == 0)
{
LOG("not a group member");
- ProtoBroadcastAck(m_szModuleName,data->hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED,
+ ProtoBroadcastAck(data->hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED,
(HANDLE) (this->msgIdHeader + this->msgId), (LPARAM) "You cannot send messages to groups if you are not a member.");
}
else if (!db_get_s(data->hContact, m_szModuleName,"ID", &dbv, DBVT_ASCIIZ) &&
@@ -88,20 +88,20 @@ void WhatsAppProto::SendMsgWorker(void* p) catch (exception &e)
{
LOG("exception: %s", e.what());
- ProtoBroadcastAck(m_szModuleName,data->hContact,ACKTYPE_MESSAGE,ACKRESULT_FAILED,
+ ProtoBroadcastAck(data->hContact,ACKTYPE_MESSAGE,ACKRESULT_FAILED,
(HANDLE) (this->msgIdHeader + this->msgId), (LPARAM) e.what());
}
catch (...)
{
LOG("unknown exception");
- ProtoBroadcastAck(m_szModuleName,data->hContact,ACKTYPE_MESSAGE,ACKRESULT_FAILED,
+ ProtoBroadcastAck(data->hContact,ACKTYPE_MESSAGE,ACKRESULT_FAILED,
(HANDLE) (this->msgIdHeader + this->msgId), (LPARAM) "Failed sending message");
}
}
else
{
LOG("No connection");
- ProtoBroadcastAck(m_szModuleName,data->hContact,ACKTYPE_MESSAGE,ACKRESULT_FAILED,
+ ProtoBroadcastAck(data->hContact,ACKTYPE_MESSAGE,ACKRESULT_FAILED,
(HANDLE) (this->msgIdHeader + this->msgId), (LPARAM) "You cannot send messages when you are offline.");
}
@@ -189,7 +189,7 @@ void WhatsAppProto::onMessageStatusUpdate(FMessage* fmsg) ss >> id;
if (state == 1)
- ProtoBroadcastAck(m_szModuleName, hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE) (header + id),0);
+ ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE) (header + id),0);
if (db_get_dw(hContact, m_szModuleName, WHATSAPP_KEY_LAST_MSG_ID_HEADER, 0) == header &&
db_get_dw(hContact, m_szModuleName, WHATSAPP_KEY_LAST_MSG_ID, -1) == id)
|