summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/m_core.h16
-rw-r--r--include/m_database.h4
-rw-r--r--include/m_protoint.h18
-rw-r--r--protocols/FacebookRM/src/avatars.cpp8
-rw-r--r--protocols/FacebookRM/src/captcha.cpp2
-rw-r--r--protocols/FacebookRM/src/chat.cpp6
-rw-r--r--protocols/FacebookRM/src/communication.cpp2
-rw-r--r--protocols/FacebookRM/src/contacts.cpp10
-rw-r--r--protocols/FacebookRM/src/json.cpp2
-rw-r--r--protocols/FacebookRM/src/proto.cpp6
10 files changed, 37 insertions, 37 deletions
diff --git a/include/m_core.h b/include/m_core.h
index 2596a01d42..fea5e37baf 100644
--- a/include/m_core.h
+++ b/include/m_core.h
@@ -94,12 +94,12 @@ typedef INT_PTR (*MIRANDASERVICEOBJPARAM)(void*, WPARAM, LPARAM, LPARAM);
MIR_CORE_DLL(HANDLE) CreateHookableEvent(const char *name);
MIR_CORE_DLL(int) DestroyHookableEvent(HANDLE hEvent);
MIR_CORE_DLL(int) SetHookDefaultForHookableEvent(HANDLE hEvent, MIRANDAHOOK pfnHook);
-MIR_CORE_DLL(int) CallPluginEventHook(HINSTANCE hInst, HANDLE hEvent, WPARAM wParam, LPARAM lParam);
-MIR_CORE_DLL(int) NotifyEventHooks(HANDLE hEvent, WPARAM wParam, LPARAM lParam);
-MIR_CORE_DLL(int) NotifyFastHook(HANDLE hEvent, WPARAM wParam, LPARAM lParam);
+MIR_CORE_DLL(int) CallPluginEventHook(HINSTANCE hInst, HANDLE hEvent, WPARAM wParam = 0, LPARAM lParam = 0);
+MIR_CORE_DLL(int) NotifyEventHooks(HANDLE hEvent, WPARAM wParam = 0, LPARAM lParam = 0);
+MIR_CORE_DLL(int) NotifyFastHook(HANDLE hEvent, WPARAM wParam = 0, LPARAM lParam = 0);
MIR_CORE_DLL(HANDLE) HookEvent(const char* name, MIRANDAHOOK hookProc);
-MIR_CORE_DLL(HANDLE) HookEventParam(const char* name, MIRANDAHOOKPARAM hookProc, LPARAM lParam);
+MIR_CORE_DLL(HANDLE) HookEventParam(const char* name, MIRANDAHOOKPARAM hookProc, LPARAM lParam = 0);
MIR_CORE_DLL(HANDLE) HookEventObj(const char* name, MIRANDAHOOKOBJ hookProc, void* object);
MIR_CORE_DLL(HANDLE) HookEventObjParam(const char* name, MIRANDAHOOKOBJPARAM hookProc, void* object, LPARAM lParam);
MIR_CORE_DLL(HANDLE) HookEventMessage(const char* name, HWND hwnd, UINT message);
@@ -115,16 +115,16 @@ MIR_CORE_DLL(HANDLE) CreateProtoServiceFunction(const char *szModule, const cha
MIR_CORE_DLL(int) DestroyServiceFunction(HANDLE hService);
MIR_CORE_DLL(int) ServiceExists(const char *name);
-MIR_CORE_DLL(INT_PTR) CallService(const char *name, WPARAM wParam, LPARAM lParam);
-MIR_CORE_DLL(INT_PTR) CallServiceSync(const char *name, WPARAM wParam, LPARAM lParam);
+MIR_CORE_DLL(INT_PTR) CallService(const char *name, WPARAM wParam = 0, LPARAM lParam = 0);
+MIR_CORE_DLL(INT_PTR) CallServiceSync(const char *name, WPARAM wParam = 0, LPARAM lParam = 0);
MIR_CORE_DLL(int) CallFunctionAsync(void (__stdcall *func)(void *), void *arg);
MIR_CORE_DLL(void) KillModuleServices(HINSTANCE hInst);
MIR_CORE_DLL(void) KillObjectServices(void* pObject);
MIR_APP_DLL(int) ProtoServiceExists(LPCSTR szModule, const char *szService);
-MIR_APP_DLL(INT_PTR) CallContactService(MCONTACT, const char*, WPARAM, LPARAM);
-MIR_APP_DLL(INT_PTR) CallProtoService(LPCSTR szModule, const char *szService, WPARAM wParam, LPARAM lParam);
+MIR_APP_DLL(INT_PTR) CallContactService(MCONTACT, const char*, WPARAM wParam = 0, LPARAM lParam = 0);
+MIR_APP_DLL(INT_PTR) CallProtoService(LPCSTR szModule, const char *szService, WPARAM wParam = 0, LPARAM lParam = 0);
///////////////////////////////////////////////////////////////////////////////
// exceptions
diff --git a/include/m_database.h b/include/m_database.h
index 9fb0cf23df..1d032b044f 100644
--- a/include/m_database.h
+++ b/include/m_database.h
@@ -287,8 +287,8 @@ MIR_CORE_DLL(MEVENT) db_event_prev(MCONTACT hContact, MEVENT hDbEvent);
// Database settings
MIR_CORE_DLL(INT_PTR) db_get(MCONTACT hContact, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv);
-MIR_CORE_DLL(int) db_get_b(MCONTACT hContact, LPCSTR szModule, LPCSTR szSetting, int errorValue);
-MIR_CORE_DLL(int) db_get_w(MCONTACT hContact, LPCSTR szModule, LPCSTR szSetting, int errorValue);
+MIR_CORE_DLL(int) db_get_b(MCONTACT hContact, LPCSTR szModule, LPCSTR szSetting, int errorValue = 0);
+MIR_CORE_DLL(int) db_get_w(MCONTACT hContact, LPCSTR szModule, LPCSTR szSetting, int errorValue = 0);
MIR_CORE_DLL(DWORD) db_get_dw(MCONTACT hContact, LPCSTR szModule, LPCSTR szSetting, DWORD errorValue);
MIR_CORE_DLL(char*) db_get_sa(MCONTACT hContact, LPCSTR szModule, LPCSTR szSetting);
MIR_CORE_DLL(wchar_t*) db_get_wsa(MCONTACT hContact, LPCSTR szModule, LPCSTR szSetting);
diff --git a/include/m_protoint.h b/include/m_protoint.h
index 515372d603..3c5cb5f39d 100644
--- a/include/m_protoint.h
+++ b/include/m_protoint.h
@@ -115,32 +115,32 @@ struct MIR_APP_EXPORT PROTO_INTERFACE : public MZeroedObject
__forceinline void WindowUnsubscribe(HWND hwnd) {
::ProtoWindowRemove(this, hwnd); }
- __forceinline INT_PTR ProtoBroadcastAck(MCONTACT hContact, int type, int hResult, HANDLE hProcess, LPARAM lParam) {
+ __forceinline INT_PTR ProtoBroadcastAck(MCONTACT hContact, int type, int hResult, HANDLE hProcess, LPARAM lParam = 0) {
return ::ProtoBroadcastAck(m_szModuleName, hContact, type, hResult, hProcess, lParam); }
__forceinline INT_PTR delSetting(const char *name) { return db_unset(NULL, m_szModuleName, name); }
__forceinline INT_PTR delSetting(MCONTACT hContact, const char *name) { return db_unset(hContact, m_szModuleName, name); }
- __forceinline bool getBool(const char *name, bool defaultValue) {
+ __forceinline bool getBool(const char *name, bool defaultValue = false) {
return db_get_b(NULL, m_szModuleName, name, defaultValue) != 0; }
- __forceinline bool getBool(MCONTACT hContact, const char *name, bool defaultValue) {
+ __forceinline bool getBool(MCONTACT hContact, const char *name, bool defaultValue = false) {
return db_get_b(hContact, m_szModuleName, name, defaultValue) != 0; }
__forceinline bool isChatRoom(MCONTACT hContact) { return getBool(hContact, "ChatRoom", false); }
- __forceinline int getByte(const char *name, BYTE defaultValue) {
+ __forceinline int getByte(const char *name, BYTE defaultValue = 0) {
return db_get_b(NULL, m_szModuleName, name, defaultValue); }
- __forceinline int getByte(MCONTACT hContact, const char *name, BYTE defaultValue) {
+ __forceinline int getByte(MCONTACT hContact, const char *name, BYTE defaultValue = 0) {
return db_get_b(hContact, m_szModuleName, name, defaultValue); }
- __forceinline int getWord(const char *name, WORD defaultValue) {
+ __forceinline int getWord(const char *name, WORD defaultValue = 0) {
return db_get_w(NULL, m_szModuleName, name, defaultValue); }
- __forceinline int getWord(MCONTACT hContact, const char *name, WORD defaultValue) {
+ __forceinline int getWord(MCONTACT hContact, const char *name, WORD defaultValue = 0) {
return db_get_w(hContact, m_szModuleName, name, defaultValue); }
- __forceinline DWORD getDword(const char *name, DWORD defaultValue) {
+ __forceinline DWORD getDword(const char *name, DWORD defaultValue = 0) {
return db_get_dw(NULL, m_szModuleName, name, defaultValue); }
- __forceinline DWORD getDword(MCONTACT hContact, const char *name, DWORD defaultValue) {
+ __forceinline DWORD getDword(MCONTACT hContact, const char *name, DWORD defaultValue = 0) {
return db_get_dw(hContact, m_szModuleName, name, defaultValue); }
__forceinline INT_PTR getString(const char *name, DBVARIANT *result) {
diff --git a/protocols/FacebookRM/src/avatars.cpp b/protocols/FacebookRM/src/avatars.cpp
index 15abcdd60f..047f9a29d2 100644
--- a/protocols/FacebookRM/src/avatars.cpp
+++ b/protocols/FacebookRM/src/avatars.cpp
@@ -76,11 +76,11 @@ void FacebookProto::CheckAvatarChange(MCONTACT hContact, const std::string &imag
if (!hContact) {
PROTO_AVATAR_INFORMATION ai = { 0 };
if (GetAvatarInfo(update_required ? GAIF_FORCE : 0, (LPARAM)&ai) != GAIR_WAITFOR)
- CallService(MS_AV_REPORTMYAVATARCHANGED, (WPARAM)m_szModuleName, 0);
+ CallService(MS_AV_REPORTMYAVATARCHANGED, (WPARAM)m_szModuleName);
}
else if (update_required) {
db_set_b(hContact, "ContactPhoto", "NeedUpdate", 1);
- ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, 0);
+ ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, 0);
}
}
@@ -110,9 +110,9 @@ void FacebookProto::UpdateAvatarWorker(void *)
bool success = facy.save_url(url + params, ai.filename, nlc);
if (ai.hContact)
- ProtoBroadcastAck(ai.hContact, ACKTYPE_AVATAR, success ? ACKRESULT_SUCCESS : ACKRESULT_FAILED, (HANDLE)&ai, 0);
+ ProtoBroadcastAck(ai.hContact, ACKTYPE_AVATAR, success ? ACKRESULT_SUCCESS : ACKRESULT_FAILED, (HANDLE)&ai);
else if (success)
- CallService(MS_AV_REPORTMYAVATARCHANGED, (WPARAM)m_szModuleName, 0);
+ CallService(MS_AV_REPORTMYAVATARCHANGED, (WPARAM)m_szModuleName);
}
ScopedLock s(avatar_lock_);
diff --git a/protocols/FacebookRM/src/captcha.cpp b/protocols/FacebookRM/src/captcha.cpp
index 98cc51bd1e..3d19823b03 100644
--- a/protocols/FacebookRM/src/captcha.cpp
+++ b/protocols/FacebookRM/src/captcha.cpp
@@ -128,7 +128,7 @@ bool FacebookProto::RunCaptchaForm(std::string captchaUrl, std::string &result)
memio.iLen = reply->dataLength;
memio.pBuf = reply->pData;
memio.fif = FIF_UNKNOWN; /* detect */
- param.bmp = (HBITMAP)CallService(MS_IMG_LOADFROMMEM, (WPARAM)&memio, 0);
+ param.bmp = (HBITMAP)CallService(MS_IMG_LOADFROMMEM, (WPARAM)&memio);
BITMAP bmp = { 0 };
GetObject(param.bmp, sizeof(bmp), &bmp);
diff --git a/protocols/FacebookRM/src/chat.cpp b/protocols/FacebookRM/src/chat.cpp
index e6e29ddb90..674bbae204 100644
--- a/protocols/FacebookRM/src/chat.cpp
+++ b/protocols/FacebookRM/src/chat.cpp
@@ -101,7 +101,7 @@ int FacebookProto::OnGCEvent(WPARAM, LPARAM lParam)
if (!hContact)
break;
- CallService(MS_MSG_SENDMESSAGET, hContact, 0);
+ CallService(MS_MSG_SENDMESSAGET, hContact);
break;
}
@@ -140,11 +140,11 @@ int FacebookProto::OnGCEvent(WPARAM, LPARAM lParam)
switch (hook->dwData)
{
case 10:
- CallService(MS_USERINFO_SHOWDIALOG, hContact, 0);
+ CallService(MS_USERINFO_SHOWDIALOG, hContact);
break;
case 20:
- CallService(MS_HISTORY_SHOWCONTACTHISTORY, hContact, 0);
+ CallService(MS_HISTORY_SHOWCONTACTHISTORY, hContact);
break;
case 110:
diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp
index 2c50763622..22cdff0cf2 100644
--- a/protocols/FacebookRM/src/communication.cpp
+++ b/protocols/FacebookRM/src/communication.cpp
@@ -695,7 +695,7 @@ void facebook_client::erase_reader(MCONTACT hContact)
parent->delSetting(hContact, FACEBOOK_KEY_MESSAGE_READ);
readers.erase(hContact);
- CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hContact, NULL);
+ CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hContact);
}
void loginError(FacebookProto *proto, std::string error_str) {
diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp
index 184713d917..7083a918ee 100644
--- a/protocols/FacebookRM/src/contacts.cpp
+++ b/protocols/FacebookRM/src/contacts.cpp
@@ -86,7 +86,7 @@ MCONTACT FacebookProto::ChatIDToHContact(const std::string &chat_id)
auto it = facy.chat_id_to_hcontact.find(chat_id);
if (it != facy.chat_id_to_hcontact.end()) {
// Check if contact is still valid
- if (CallService(MS_DB_CONTACT_IS, (WPARAM)it->second, 0) == 1)
+ if (CallService(MS_DB_CONTACT_IS, (WPARAM)it->second) == 1)
return it->second;
else
facy.chat_id_to_hcontact.erase(it);
@@ -118,7 +118,7 @@ MCONTACT FacebookProto::ContactIDToHContact(const std::string &user_id)
std::map<std::string, MCONTACT>::iterator it = facy.user_id_to_hcontact.find(user_id);
if (it != facy.user_id_to_hcontact.end()) {
// Check if contact is still valid
- if (CallService(MS_DB_CONTACT_IS, (WPARAM)it->second, 0) == 1)
+ if (CallService(MS_DB_CONTACT_IS, (WPARAM)it->second) == 1)
return it->second;
else
facy.user_id_to_hcontact.erase(it);
@@ -350,10 +350,10 @@ MCONTACT FacebookProto::AddToContactList(facebook_user* fbu, ContactType type, b
}
// Try to make a new contact
- MCONTACT hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ MCONTACT hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD);
if (hContact && Proto_AddToContact(hContact, m_szModuleName) != 0) {
- CallService(MS_DB_CONTACT_DELETE, hContact, 0);
+ CallService(MS_DB_CONTACT_DELETE, hContact);
hContact = NULL;
}
@@ -596,7 +596,7 @@ void FacebookProto::IgnoreFriendshipRequest(void *data)
// Delete this contact, if he's temporary
if (db_get_b(hContact, "CList", "NotOnList", 0))
- CallService(MS_DB_CONTACT_DELETE, hContact, 0);
+ CallService(MS_DB_CONTACT_DELETE, hContact);
}
else facy.client_notify(TranslateT("Error occurred when ignoring friendship request."));
diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp
index d8a43f9255..88bc191b59 100644
--- a/protocols/FacebookRM/src/json.cpp
+++ b/protocols/FacebookRM/src/json.cpp
@@ -693,7 +693,7 @@ int facebook_json_parser::parse_messages(std::string *data, std::vector< faceboo
CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hChatContact, (LPARAM)&st);
}
else {
- CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hChatContact, NULL);
+ CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hChatContact);
}
// TODO: support proper MS_PROTO_CONTACTISTYPING service for chatrooms (when it will be implemented)
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp
index 5c14ce4f95..13d816fac3 100644
--- a/protocols/FacebookRM/src/proto.cpp
+++ b/protocols/FacebookRM/src/proto.cpp
@@ -156,7 +156,7 @@ DWORD_PTR FacebookProto::GetCaps(int type, MCONTACT)
{
DWORD_PTR flags = PF1_IM | PF1_CHAT | PF1_SERVERCLIST | PF1_AUTHREQ | /*PF1_ADDED |*/ PF1_BASICSEARCH | PF1_SEARCHBYEMAIL | PF1_SEARCHBYNAME | PF1_ADDSEARCHRES; // | PF1_VISLIST | PF1_INVISLIST;
- if (getByte(FACEBOOK_KEY_SET_MIRANDA_STATUS, 0))
+ if (getByte(FACEBOOK_KEY_SET_MIRANDA_STATUS))
return flags |= PF1_MODEMSG;
else
return flags |= PF1_MODEMSGRECV;
@@ -164,7 +164,7 @@ DWORD_PTR FacebookProto::GetCaps(int type, MCONTACT)
case PFLAGNUM_2:
return PF2_ONLINE | PF2_INVISIBLE | PF2_ONTHEPHONE | PF2_IDLE; // | PF2_SHORTAWAY;
case PFLAGNUM_3:
- if (getByte(FACEBOOK_KEY_SET_MIRANDA_STATUS, 0))
+ if (getByte(FACEBOOK_KEY_SET_MIRANDA_STATUS))
return PF2_ONLINE; // | PF2_SHORTAWAY;
else
return 0;
@@ -761,7 +761,7 @@ INT_PTR FacebookProto::CancelFriendship(WPARAM wParam, LPARAM lParam)
MCONTACT hContact = MCONTACT(wParam);
// Ignore groupchats and, if deleting, also not-friends
- if (isChatRoom(hContact) || (deleting && getByte(hContact, FACEBOOK_KEY_CONTACT_TYPE, 0) != CONTACT_FRIEND))
+ if (isChatRoom(hContact) || (deleting && getByte(hContact, FACEBOOK_KEY_CONTACT_TYPE) != CONTACT_FRIEND))
return 0;
ptrT tname(getTStringA(hContact, FACEBOOK_KEY_NICK));