diff options
author | George Hazan <george.hazan@gmail.com> | 2013-10-11 14:01:25 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-10-11 14:01:25 +0000 |
commit | 773421e8ba17637d994088c393d406226b516a30 (patch) | |
tree | 130c0bf529e30f493ae4f2abbe1230d31fecdeed /protocols/WhatsApp | |
parent | 3fc8b6f686262e8a595fc10b2bd947526ca77bdc (diff) |
- m_hNetlibUser moved to PROTO_INTERFACE;
- unified protocol loggers
git-svn-id: http://svn.miranda-ng.org/main/trunk@6435 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/WhatsApp')
-rw-r--r-- | protocols/WhatsApp/src/chat.cpp | 2 | ||||
-rw-r--r-- | protocols/WhatsApp/src/connection.cpp | 18 | ||||
-rw-r--r-- | protocols/WhatsApp/src/contacts.cpp | 34 | ||||
-rw-r--r-- | protocols/WhatsApp/src/definitions.h | 11 | ||||
-rw-r--r-- | protocols/WhatsApp/src/messages.cpp | 14 | ||||
-rw-r--r-- | protocols/WhatsApp/src/proto.cpp | 32 | ||||
-rw-r--r-- | protocols/WhatsApp/src/proto.h | 30 | ||||
-rw-r--r-- | protocols/WhatsApp/src/theme.cpp | 8 |
8 files changed, 62 insertions, 87 deletions
diff --git a/protocols/WhatsApp/src/chat.cpp b/protocols/WhatsApp/src/chat.cpp index 27d1cc3b22..e978c9f0ee 100644 --- a/protocols/WhatsApp/src/chat.cpp +++ b/protocols/WhatsApp/src/chat.cpp @@ -38,7 +38,7 @@ int WhatsAppProto::OnChatOutgoing(WPARAM wParam, LPARAM lParam) HANDLE hContact = this->ContactIDToHContact(chat_id);
if (hContact)
{
- LOG("**Chat - Outgoing message: %s", text);
+ debugLogA("**Chat - Outgoing message: %s", text);
this->SendMsg(hContact, IS_CHAT, msg.c_str());
// #TODO Move to SendMsgWorker, otherwise all messages are "acknowledged" by Miranda
diff --git a/protocols/WhatsApp/src/connection.cpp b/protocols/WhatsApp/src/connection.cpp index d7cfd7c93e..9aae55ac32 100644 --- a/protocols/WhatsApp/src/connection.cpp +++ b/protocols/WhatsApp/src/connection.cpp @@ -33,7 +33,7 @@ void WhatsAppProto::ChangeStatus(void*) {
SetEvent(update_loop_lock_);
this->conn->forceShutdown();
- LOG("Forced shutdown");
+ debugLogA("Forced shutdown");
}
}
}
@@ -128,7 +128,7 @@ void WhatsAppProto::stayConnectedLoop(void*) desiredStatus = this->m_iDesiredStatus;
if (desiredStatus == ID_STATUS_OFFLINE || error)
{
- LOG("Set status to offline");
+ debugLogA("Set status to offline");
SetAllContactStatuses( ID_STATUS_OFFLINE, true );
this->ToggleStatusMenuItems(false);
int prevStatus = this->m_iStatus;
@@ -137,7 +137,7 @@ void WhatsAppProto::stayConnectedLoop(void*) break;
}
- LOG("Connecting...");
+ debugLogA("Connecting...");
this->m_iStatus = ID_STATUS_CONNECTING;
ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) ID_STATUS_OFFLINE, m_iStatus);
@@ -167,7 +167,7 @@ void WhatsAppProto::stayConnectedLoop(void*) connection->sendAvailableForChat();
}
- LOG("Set status to online");
+ debugLogA("Set status to online");
this->m_iStatus = desiredStatus;
ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE )m_iStatus, ID_STATUS_CONNECTING);
this->ToggleStatusMenuItems(true);
@@ -181,7 +181,7 @@ void WhatsAppProto::stayConnectedLoop(void*) this->lastPongTime = time(NULL);
cont = connection->read();
}
- LOG("Exit from read-loop");
+ debugLogA("Exit from read-loop");
CODE_BLOCK_CATCH(WAException)
error = true;
@@ -191,7 +191,7 @@ void WhatsAppProto::stayConnectedLoop(void*) error = true;
CODE_BLOCK_END
}
- LOG("Break out from loop");
+ debugLogA("Break out from loop");
}
void WhatsAppProto::sentinelLoop(void*)
@@ -207,7 +207,7 @@ void WhatsAppProto::sentinelLoop(void*) if (quietInterval >= MAX_SILENT_INTERVAL)
{
CODE_BLOCK_TRY
- LOG("send ping");
+ debugLogA("send ping");
this->lastPongTime = time(NULL);
this->connection->sendPing();
CODE_BLOCK_CATCH(exception)
@@ -224,14 +224,14 @@ void WhatsAppProto::sentinelLoop(void*) }
}
ResetEvent(update_loop_lock_);
- LOG("Exiting sentinel loop");
+ debugLogA("Exiting sentinel loop");
}
void WhatsAppProto::onPing(const std::string& id)
{
if (this->isOnline()) {
CODE_BLOCK_TRY
- LOG("Sending pong with id %s", id.c_str());
+ debugLogA("Sending pong with id %s", id.c_str());
this->connection->sendPong(id);
CODE_BLOCK_CATCH_ALL
}
diff --git a/protocols/WhatsApp/src/contacts.cpp b/protocols/WhatsApp/src/contacts.cpp index 8ed8b0e918..ead537fc1d 100644 --- a/protocols/WhatsApp/src/contacts.cpp +++ b/protocols/WhatsApp/src/contacts.cpp @@ -61,7 +61,7 @@ HANDLE WhatsAppProto::AddToContactList(const std::string& jid, BYTE type, bool d if (CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName) == 0)
{
setString(hContact, "ID", jid.c_str());
- LOG("Added contact %s", jid.c_str());
+ debugLogA("Added contact %s", jid.c_str());
setString(hContact, "MirVer", "WhatsApp");
db_unset(hContact, "CList", "MyHandle");
db_set_b(hContact, "CList", "NotOnList", 1);
@@ -315,7 +315,7 @@ void WhatsAppProto::onSendGetPicture(const std::string& jid, const std::vector<u HANDLE hContact = this->ContactIDToHContact(jid);
if (hContact)
{
- LOG("Updating avatar for jid %s", jid.c_str());
+ debugLogA("Updating avatar for jid %s", jid.c_str());
// Save avatar
std::tstring filename = this->GetAvatarFolder() ;
@@ -396,11 +396,11 @@ void WhatsAppProto::SendGetGroupInfoWorker(void* data) void WhatsAppProto::onGroupInfo(const std::string& gjid, const std::string& ownerJid, const std::string& subject, const std::string& createrJid, int paramInt1, int paramInt2)
{
- LOG("'%s', '%s', '%s', '%s'", gjid.c_str(), ownerJid.c_str(), subject.c_str(), createrJid.c_str());
+ debugLogA("'%s', '%s', '%s', '%s'", gjid.c_str(), ownerJid.c_str(), subject.c_str(), createrJid.c_str());
HANDLE hContact = ContactIDToHContact(gjid);
if (!hContact)
{
- LOG("Group info requested for non existing contact '%s'", gjid.c_str());
+ debugLogA("Group info requested for non existing contact '%s'", gjid.c_str());
return;
}
setByte(hContact, "SimpleChatRoom", ownerJid.compare(this->jid) == 0 ? 2 : 1);
@@ -411,18 +411,18 @@ void WhatsAppProto::onGroupInfo(const std::string& gjid, const std::string& owne void WhatsAppProto::onGroupInfoFromList(const std::string& paramString1, const std::string& paramString2, const std::string& paramString3, const std::string& paramString4, int paramInt1, int paramInt2)
{
// Called before onOwningGroups() or onParticipatingGroups() is called!
- LOG("");
+ debugLogA("");
}
void WhatsAppProto::onGroupNewSubject(const std::string& from, const std::string& author, const std::string& newSubject, int paramInt)
{
- LOG("'%s', '%s', '%s'", from.c_str(), author.c_str(), newSubject.c_str());
+ debugLogA("'%s', '%s', '%s'", from.c_str(), author.c_str(), newSubject.c_str());
HANDLE hContact = this->AddToContactList(from, 0, false, newSubject.c_str(), true);
}
void WhatsAppProto::onGroupAddUser(const std::string& paramString1, const std::string& paramString2)
{
- LOG("%s - user: %s", paramString1.c_str(), paramString2.c_str());
+ debugLogA("%s - user: %s", paramString1.c_str(), paramString2.c_str());
HANDLE hContact = this->AddToContactList(paramString1);
std::string groupName(this->GetContactDisplayName(hContact));
@@ -445,7 +445,7 @@ void WhatsAppProto::onGroupAddUser(const std::string& paramString1, const std::s void WhatsAppProto::onGroupRemoveUser(const std::string& paramString1, const std::string& paramString2)
{
- LOG("%s - user: %s", paramString1.c_str(), paramString2.c_str());
+ debugLogA("%s - user: %s", paramString1.c_str(), paramString2.c_str());
HANDLE hContact = this->ContactIDToHContact(paramString1);
if (!hContact)
return;
@@ -472,7 +472,7 @@ void WhatsAppProto::onGroupRemoveUser(const std::string& paramString1, const std void WhatsAppProto::onLeaveGroup(const std::string& paramString)
{
// Won't be called for unknown reasons!
- LOG("%s", this->GetContactDisplayName(paramString).c_str());
+ debugLogA("%s", this->GetContactDisplayName(paramString).c_str());
HANDLE hContact = this->ContactIDToHContact(paramString);
if (hContact)
setByte(hContact, "IsGroupMember", 0);
@@ -480,7 +480,7 @@ void WhatsAppProto::onLeaveGroup(const std::string& paramString) void WhatsAppProto::onGetParticipants(const std::string& gjid, const std::vector<string>& participants)
{
- LOG("%s", this->GetContactDisplayName(gjid).c_str());
+ debugLogA("%s", this->GetContactDisplayName(gjid).c_str());
HANDLE hUserContact;
HANDLE hContact = this->ContactIDToHContact(gjid);
@@ -536,7 +536,7 @@ INT_PTR __cdecl WhatsAppProto::OnAddContactToGroup(WPARAM wParam, LPARAM, LPARAM {
string a = GetContactDisplayName((HANDLE) wParam);
string b = GetContactDisplayName((HANDLE) lParam);
- LOG("Request add user %s to group %s", a.c_str(), b.c_str());
+ debugLogA("Request add user %s to group %s", a.c_str(), b.c_str());
if (!this->isOnline())
return NULL;
@@ -564,7 +564,7 @@ INT_PTR __cdecl WhatsAppProto::OnRemoveContactFromGroup(WPARAM wParam, LPARAM, L {
string a = GetContactDisplayName((HANDLE) wParam);
string b = GetContactDisplayName((HANDLE) lParam);
- LOG("Request remove user %s from group %s", a.c_str(), b.c_str());
+ debugLogA("Request remove user %s from group %s", a.c_str(), b.c_str());
if (!this->isOnline())
return NULL;
@@ -589,13 +589,13 @@ INT_PTR __cdecl WhatsAppProto::OnRemoveContactFromGroup(WPARAM wParam, LPARAM, L void WhatsAppProto::onOwningGroups(const std::vector<string>& paramVector)
{
- LOG("");
+ debugLogA("");
this->HandleReceiveGroups(paramVector, true);
}
void WhatsAppProto::onParticipatingGroups(const std::vector<string>& paramVector)
{
- LOG("");
+ debugLogA("");
this->HandleReceiveGroups(paramVector, false);
}
@@ -629,7 +629,7 @@ void WhatsAppProto::HandleReceiveGroups(const std::vector<string>& groups, bool {
if (IsMyContact(hContact) && getByte(hContact, "SimpleChatRoom", 0) > 0)
{
- //LOG("Set IsGroupMember to 0 for '%s'", this->GetContactDisplayName(hContact).c_str());
+ //debugLogA("Set IsGroupMember to 0 for '%s'", this->GetContactDisplayName(hContact).c_str());
setByte(hContact, "IsGroupMember", isMember.find(hContact) == isMember.end() ? 0 : 1);
}
}
@@ -639,7 +639,7 @@ void WhatsAppProto::HandleReceiveGroups(const std::vector<string>& groups, bool void WhatsAppProto::onGroupCreated(const std::string& paramString1, const std::string& paramString2)
{
// Must be received after onOwningGroups() :/
- LOG("%s / %s", paramString1.c_str(), paramString2.c_str());
+ debugLogA("%s / %s", paramString1.c_str(), paramString2.c_str());
string jid = paramString2 +string("@")+ paramString1;
HANDLE hContact = this->AddToContactList(jid, 0, false, NULL, true);
setByte(hContact, "SimpleChatRoom", 2);
@@ -648,7 +648,7 @@ void WhatsAppProto::onGroupCreated(const std::string& paramString1, const std::s // Menu-handler
INT_PTR __cdecl WhatsAppProto::OnCreateGroup(WPARAM wParam, LPARAM lParam)
{
- LOG("");
+ debugLogA("");
input_box* ib = new input_box;
ib->defaultValue = _T("");
ib->limit = WHATSAPP_GROUP_NAME_LIMIT;
diff --git a/protocols/WhatsApp/src/definitions.h b/protocols/WhatsApp/src/definitions.h index 4e24139d67..4817f56a98 100644 --- a/protocols/WhatsApp/src/definitions.h +++ b/protocols/WhatsApp/src/definitions.h @@ -4,13 +4,12 @@ #define FLAG_CONTAINS(x,y) ( ( x & y ) == y )
#define REMOVE_FLAG(x,y) ( x = ( x & ~y ))
-#define LOG(fmt, ...) Log(__FUNCTION__, fmt, ##__VA_ARGS__)
#define CODE_BLOCK_TRY try {
-#define CODE_BLOCK_CATCH(ex) } catch (ex& e) { LOG("Exception: %s", e.what());
-#define CODE_BLOCK_CATCH_UNKNOWN } catch (...) { LOG("Unknown exception");
-#define CODE_BLOCK_CATCH_ALL } catch (WAException& e) { LOG("Exception: %s", e.what()); \
- } catch (exception& e) { LOG("Exception: %s", e.what()); \
- } catch (...) { LOG("Unknown exception"); }
+#define CODE_BLOCK_CATCH(ex) } catch (ex& e) { debugLogA("Exception: %s", e.what());
+#define CODE_BLOCK_CATCH_UNKNOWN } catch (...) { debugLogA("Unknown exception");
+#define CODE_BLOCK_CATCH_ALL } catch (WAException& e) { debugLogA("Exception: %s", e.what()); \
+ } catch (exception& e) { debugLogA("Exception: %s", e.what()); \
+ } catch (...) { debugLogA("Unknown exception"); }
#define CODE_BLOCK_END }
#define NIIF_INTERN_TCHAR NIIF_INTERN_UNICODE
diff --git a/protocols/WhatsApp/src/messages.cpp b/protocols/WhatsApp/src/messages.cpp index ba0b4210f5..00ddab1e12 100644 --- a/protocols/WhatsApp/src/messages.cpp +++ b/protocols/WhatsApp/src/messages.cpp @@ -42,7 +42,7 @@ void WhatsAppProto::onMessageForMe(FMessage* paramFMessage, bool paramBoolean) int WhatsAppProto::SendMsg(HANDLE hContact, int flags, const char *msg)
{
- LOG("");
+ debugLogA("");
int msgId = ++(this->msgId);
ForkThread( &WhatsAppProto::SendMsgWorker, new send_direct(hContact, msg, (HANDLE) msgId, flags & IS_CHAT));
@@ -51,7 +51,7 @@ int WhatsAppProto::SendMsg(HANDLE hContact, int flags, const char *msg) void WhatsAppProto::SendMsgWorker(void* p)
{
- LOG("");
+ debugLogA("");
if (p == NULL)
return;
@@ -60,7 +60,7 @@ void WhatsAppProto::SendMsgWorker(void* p) if (getByte(data->hContact, "SimpleChatRoom", 0) > 0 && getByte(data->hContact, "IsGroupMember", 0) == 0)
{
- LOG("not a group member");
+ debugLogA("not a group member");
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.");
}
@@ -85,20 +85,20 @@ void WhatsAppProto::SendMsgWorker(void* p) }
catch (exception &e)
{
- LOG("exception: %s", e.what());
+ debugLogA("exception: %s", e.what());
ProtoBroadcastAck(data->hContact,ACKTYPE_MESSAGE,ACKRESULT_FAILED,
(HANDLE) (this->msgIdHeader + this->msgId), (LPARAM) e.what());
}
catch (...)
{
- LOG("unknown exception");
+ debugLogA("unknown exception");
ProtoBroadcastAck(data->hContact,ACKTYPE_MESSAGE,ACKRESULT_FAILED,
(HANDLE) (this->msgIdHeader + this->msgId), (LPARAM) "Failed sending message");
}
}
else
{
- LOG("No connection");
+ debugLogA("No connection");
ProtoBroadcastAck(data->hContact,ACKTYPE_MESSAGE,ACKRESULT_FAILED,
(HANDLE) (this->msgIdHeader + this->msgId), (LPARAM) "You cannot send messages when you are offline.");
}
@@ -163,7 +163,7 @@ void WhatsAppProto::SendTypingWorker(void* p) void WhatsAppProto::onMessageStatusUpdate(FMessage* fmsg)
{
- LOG("");
+ debugLogA("");
HANDLE hContact = this->ContactIDToHContact(fmsg->key->remote_jid);
if (hContact == 0)
diff --git a/protocols/WhatsApp/src/proto.cpp b/protocols/WhatsApp/src/proto.cpp index b362c7a059..936248b082 100644 --- a/protocols/WhatsApp/src/proto.cpp +++ b/protocols/WhatsApp/src/proto.cpp @@ -90,7 +90,7 @@ DWORD_PTR WhatsAppProto::GetCaps( int type, HANDLE hContact ) int WhatsAppProto::SetStatus( int new_status )
{
- LOG("===== Beginning SetStatus process");
+ debugLogA("===== Beginning SetStatus process");
// Routing statuses not supported by WhatsApp
switch ( new_status )
@@ -119,13 +119,13 @@ int WhatsAppProto::SetStatus( int new_status ) if (m_iStatus == ID_STATUS_CONNECTING)
{
- LOG("===== Status is connecting, no change");
+ debugLogA("===== Status is connecting, no change");
return 0;
}
if (m_iStatus == m_iDesiredStatus)
{
- LOG("===== Statuses are same, no change");
+ debugLogA("===== Statuses are same, no change");
return 0;
}
@@ -227,7 +227,7 @@ string WhatsAppProto::Register(int state, string cc, string number, string code) return ret;
}
- LOG("Server response: %s", pnlhr->pData);
+ debugLogA("Server response: %s", pnlhr->pData);
MessageBoxA(NULL, pnlhr->pData, "Debug", MB_OK);
JSONROOT resp(pnlhr->pData);
@@ -284,7 +284,7 @@ INT_PTR WhatsAppProto::SvcCreateAccMgrUI(WPARAM wParam,LPARAM lParam) int WhatsAppProto::RefreshBuddyList(WPARAM, LPARAM )
{
- LOG("");
+ debugLogA("");
if (!isOffline())
{
//ForkThread(
@@ -316,28 +316,6 @@ std::tstring WhatsAppProto::GetAvatarFolder() return def_avatar_folder_;
}
-int WhatsAppProto::Log(const char* fn, const char *fmt,...)
-{
-#if !defined(_DEBUG)
- if (!getByte(WHATSAPP_KEY_LOGGING_ENABLE, 0))
- return EXIT_SUCCESS;
-#endif
-
- va_list va;
- char text[65535];
- ScopedLock s(log_lock_);
-
- va_start(va,fmt);
- mir_vsnprintf(text,sizeof(text),fmt,va);
- va_end(va);
-
- // Write into network log
- //CallService(MS_NETLIB_LOG, (WPARAM)m_hNetlibUser, (LPARAM)text);
-
- // Write into log file
- return utils::debug::log(m_szModuleName, std::string(fn).append(" - ").append(text));
-}
-
LRESULT CALLBACK PopupDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
diff --git a/protocols/WhatsApp/src/proto.h b/protocols/WhatsApp/src/proto.h index a2be9e9e5a..10969f44fb 100644 --- a/protocols/WhatsApp/src/proto.h +++ b/protocols/WhatsApp/src/proto.h @@ -152,7 +152,6 @@ public: std::tstring def_avatar_folder_;
- HANDLE m_hNetlibUser;
WASocketConnection* conn;
WAConnection* connection;
Mutex connMutex;
@@ -171,41 +170,40 @@ public: // WhatsApp Events
virtual void onMessageForMe(FMessage* paramFMessage, bool paramBoolean);
virtual void onMessageStatusUpdate(FMessage* paramFMessage);
- virtual void onMessageError(FMessage* message, int paramInt) { LOG(""); }
+ virtual void onMessageError(FMessage* message, int paramInt) { debugLogA(""); }
virtual void onPing(const std::string& id) throw (WAException);
- virtual void onPingResponseReceived() { LOG(""); }
+ virtual void onPingResponseReceived() { debugLogA(""); }
virtual void onAvailable(const std::string& paramString, bool paramBoolean);
- virtual void onClientConfigReceived(const std::string& paramString) { LOG(""); }
+ virtual void onClientConfigReceived(const std::string& paramString) { debugLogA(""); }
virtual void onLastSeen(const std::string& paramString1, int paramInt, std::string* paramString2);
virtual void onIsTyping(const std::string& paramString, bool paramBoolean);
- virtual void onAccountChange(int paramInt, time_t expire_date) { LOG(""); }
- virtual void onPrivacyBlockListAdd(const std::string& paramString) { LOG(""); }
- virtual void onPrivacyBlockListClear() { LOG(""); }
- virtual void onDirty(const std::map<string,string>& paramHashtable) { LOG(""); }
- virtual void onDirtyResponse(int paramHashtable) { LOG(""); }
- virtual void onRelayRequest(const std::string& paramString1, int paramInt, const std::string& paramString2) { LOG(""); }
+ virtual void onAccountChange(int paramInt, time_t expire_date) { debugLogA(""); }
+ virtual void onPrivacyBlockListAdd(const std::string& paramString) { debugLogA(""); }
+ virtual void onPrivacyBlockListClear() { debugLogA(""); }
+ virtual void onDirty(const std::map<string,string>& paramHashtable) { debugLogA(""); }
+ virtual void onDirtyResponse(int paramHashtable) { debugLogA(""); }
+ virtual void onRelayRequest(const std::string& paramString1, int paramInt, const std::string& paramString2) { debugLogA(""); }
virtual void onSendGetPictureIds(std::map<string,string>* ids);
virtual void onSendGetPicture(const std::string& jid, const std::vector<unsigned char>& data, const std::string& oldId, const std::string& newId);
virtual void onPictureChanged(const std::string& from, const std::string& author, bool set);
- virtual void onDeleteAccount(bool result) { LOG(""); }
+ virtual void onDeleteAccount(bool result) { debugLogA(""); }
virtual void onGroupAddUser(const std::string& paramString1, const std::string& paramString2);
virtual void onGroupRemoveUser(const std::string& paramString1, const std::string& paramString2);
virtual void onGroupNewSubject(const std::string& from, const std::string& author, const std::string& newSubject, int paramInt);
- virtual void onServerProperties(std::map<std::string, std::string>* nameValueMap) { LOG(""); }
+ virtual void onServerProperties(std::map<std::string, std::string>* nameValueMap) { debugLogA(""); }
virtual void onGroupCreated(const std::string& paramString1, const std::string& paramString2);
virtual void onGroupInfo(const std::string& paramString1, const std::string& paramString2, const std::string& paramString3, const std::string& paramString4, int paramInt1, int paramInt2);
virtual void onGroupInfoFromList(const std::string& paramString1, const std::string& paramString2, const std::string& paramString3, const std::string& paramString4, int paramInt1, int paramInt2);
virtual void onOwningGroups(const std::vector<string>& paramVector);
- virtual void onSetSubject(const std::string& paramString) { LOG(""); }
- virtual void onAddGroupParticipants(const std::string& paramString, const std::vector<string>& paramVector, int paramHashtable) { LOG(""); }
- virtual void onRemoveGroupParticipants(const std::string& paramString, const std::vector<string>& paramVector, int paramHashtable) { LOG(""); }
+ virtual void onSetSubject(const std::string& paramString) { debugLogA(""); }
+ virtual void onAddGroupParticipants(const std::string& paramString, const std::vector<string>& paramVector, int paramHashtable) { debugLogA(""); }
+ virtual void onRemoveGroupParticipants(const std::string& paramString, const std::vector<string>& paramVector, int paramHashtable) { debugLogA(""); }
virtual void onGetParticipants(const std::string& gjid, const std::vector<string>& participants);
virtual void onParticipatingGroups(const std::vector<string>& paramVector);
virtual void onLeaveGroup(const std::string& paramString);
// Information providing
- int Log(const char* fn, const char *fmt,...);
void NotifyEvent(TCHAR* title, TCHAR* info, HANDLE contact, DWORD flags, TCHAR* url=NULL);
void NotifyEvent(const string& title, const string& info, HANDLE contact, DWORD flags, TCHAR* url=NULL);
diff --git a/protocols/WhatsApp/src/theme.cpp b/protocols/WhatsApp/src/theme.cpp index 1738577262..e5285ddf0a 100644 --- a/protocols/WhatsApp/src/theme.cpp +++ b/protocols/WhatsApp/src/theme.cpp @@ -106,9 +106,9 @@ int WhatsAppProto::OnPrebuildContactMenu(WPARAM wParam,LPARAM lParam) {
HANDLE hContact = reinterpret_cast<HANDLE>(wParam);
if (hContact)
- LOG(this->GetContactDisplayName(hContact).c_str());
+ debugLogA(this->GetContactDisplayName(hContact).c_str());
else
- LOG("No contact found");
+ debugLogA("No contact found");
if (g_hContactMenuItems[CMI_ADD_CONTACT_TO_GROUP] != NULL)
CallService("CList/RemoveContactMenuItem", (WPARAM) g_hContactMenuItems[CMI_ADD_CONTACT_TO_GROUP], (LPARAM) 0);
@@ -187,7 +187,7 @@ int WhatsAppProto::OnPrebuildContactMenu(WPARAM wParam,LPARAM lParam) map<HANDLE, map<HANDLE, bool>>::iterator groupsIt = this->isMemberByGroupContact.find(hContact);
if (groupsIt == this->isMemberByGroupContact.end())
{
- LOG("Group exists only on contact list");
+ debugLogA("Group exists only on contact list");
}
else
{
@@ -227,7 +227,7 @@ int WhatsAppProto::OnPrebuildContactMenu(WPARAM wParam,LPARAM lParam) int WhatsAppProto::OnBuildStatusMenu(WPARAM wParam,LPARAM lParam)
{
- LOG("");
+ debugLogA("");
char text[200];
strcpy(text,m_szModuleName);
char *tDest = text+strlen(text);
|