summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-02-07 14:55:50 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-02-07 14:55:50 +0300
commita4ecd3ac4b80c77d11f7af8e75983459a5a5fbfd (patch)
treea3dafa51f366a2fa86c5dc4a352c7bd9baad0c88
parentc5e390ac0a27d6ef11728deaeea7a57e00a588ed (diff)
code cleaning
-rw-r--r--protocols/MSN/src/msn_commands.cpp21
-rw-r--r--protocols/MSN/src/msn_std.cpp8
2 files changed, 16 insertions, 13 deletions
diff --git a/protocols/MSN/src/msn_commands.cpp b/protocols/MSN/src/msn_commands.cpp
index 3d61b36603..f4318216ce 100644
--- a/protocols/MSN/src/msn_commands.cpp
+++ b/protocols/MSN/src/msn_commands.cpp
@@ -221,7 +221,8 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para
if (tContentType == NULL)
return;
- if (nfyMsg) msgBody = tHeader.readFromBuffer(msgBody);
+ if (nfyMsg)
+ msgBody = tHeader.readFromBuffer(msgBody);
if (!_strnicmp(tContentType, "text/x-clientcaps", 17)) {
MimeHeaders tFileInfo;
@@ -244,7 +245,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para
if (!_strnicmp(tContentType, "text/plain", 10) ||
(!_strnicmp(tContentType, "application/user+xml", 10) && tHeader["Message-Type"] && !strncmp(tHeader["Message-Type"], "RichText", 8))) {
- MCONTACT hContact = strncmp(email, "19:", 3)?MSN_HContactFromEmail(email, nick, true, true):NULL;
+ MCONTACT hContact = strncmp(email, "19:", 3) ? MSN_HContactFromEmail(email, nick, true, true) : NULL;
if (!_stricmp(tHeader["Message-Type"], "RichText/UriObject") || !_stricmp(tHeader["Message-Type"], "RichText/Media_GenericFile")) {
ezxml_t xmli = ezxml_parse_str(msgBody, strlen(msgBody));
@@ -252,8 +253,8 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para
MSN_ProcessURIObject(hContact, xmli);
ezxml_free(xmli);
}
- } else
- if (!_stricmp(tHeader["Message-Type"], "RichText/Contacts")) {
+ }
+ else if (!_stricmp(tHeader["Message-Type"], "RichText/Contacts")) {
ezxml_t xmli = ezxml_parse_str(msgBody, mir_strlen(msgBody));
if (xmli) {
if (!mir_strcmp(xmli->name, "contacts")) {
@@ -295,11 +296,12 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para
}
ezxml_free(xmli);
}
- } else
- if (!_stricmp(tHeader["Message-Type"], "Control/Typing")) CallService(MS_PROTO_CONTACTISTYPING, hContact, 7); else
- if (!_stricmp(tHeader["Message-Type"], "Control/ClearTyping")) CallService(MS_PROTO_CONTACTISTYPING, hContact, 0);
+ }
+ else if (!_stricmp(tHeader["Message-Type"], "Control/Typing"))
+ CallService(MS_PROTO_CONTACTISTYPING, hContact, 7);
+ else if (!_stricmp(tHeader["Message-Type"], "Control/ClearTyping"))
+ CallService(MS_PROTO_CONTACTISTYPING, hContact, 0);
else {
-
const char* p = tHeader["X-MMS-IM-Format"];
bool isRtl = p != NULL && strstr(p, "RL=1") != NULL;
@@ -1164,7 +1166,8 @@ LBL_InvalidCommand:
if (bIsChat) {
hContact = MSN_HContactFromEmail(from->txt, NULL, false, false);
- if (hContact) db_unset(hContact, m_szModuleName, "syncTS");
+ if (hContact)
+ db_unset(hContact, m_szModuleName, "syncTS");
MSN_GCAddMessage(_A2T(id->txt), hContact, email, ts, sentMsg, message);
}
else if (hContact) {
diff --git a/protocols/MSN/src/msn_std.cpp b/protocols/MSN/src/msn_std.cpp
index ad00cc639e..388050a1ab 100644
--- a/protocols/MSN/src/msn_std.cpp
+++ b/protocols/MSN/src/msn_std.cpp
@@ -26,17 +26,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/////////////////////////////////////////////////////////////////////////////////////////
// Standard functions
-int CMsnProto::getStringUtf(MCONTACT hContact, const char* name, DBVARIANT* result)
+int CMsnProto::getStringUtf(MCONTACT hContact, const char *name, DBVARIANT *result)
{
return db_get_utf(hContact, m_szModuleName, name, result);
}
-int CMsnProto::getStringUtf(const char* name, DBVARIANT* result)
+int CMsnProto::getStringUtf(const char *name, DBVARIANT *result)
{
return db_get_utf(NULL, m_szModuleName, name, result);
}
-void CMsnProto::setStringUtf(MCONTACT hContact, const char* name, const char* value)
+void CMsnProto::setStringUtf(MCONTACT hContact, const char *name, const char *value)
{
db_set_utf(hContact, m_szModuleName, name, value);
}
@@ -46,7 +46,7 @@ void CMsnProto::setStringUtf(MCONTACT hContact, const char* name, const char* va
wchar_t* CMsnProto::GetContactNameT(MCONTACT hContact)
{
if (hContact)
- return (wchar_t*)pcli->pfnGetContactDisplayName(WPARAM(hContact), 0);
+ return (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0);
wchar_t *str = Contact_GetInfo(CNF_DISPLAY, NULL, m_szModuleName);
if (str != NULL) {