summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-06-21 18:27:51 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-06-21 18:27:51 +0000
commitb5c35fb3198a06b037e49ac98d456ed55664ac60 (patch)
treef8b59563b2e5ca90d2d7165efea3eebe0a57fc4d
parent4267ebcb5fd90819de23064019d1dd214e76b5ef (diff)
minor code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@5086 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rwxr-xr-xplugins/MetaContacts/src/meta_services.cpp9
-rw-r--r--plugins/SeenPlugin/src/utils.cpp12
-rw-r--r--plugins/TabSRMM/src/msgdlgutils.cpp5
-rw-r--r--protocols/IRCG/src/clist.cpp6
-rw-r--r--src/modules/clist/clistmenus.cpp8
5 files changed, 14 insertions, 26 deletions
diff --git a/plugins/MetaContacts/src/meta_services.cpp b/plugins/MetaContacts/src/meta_services.cpp
index 6bd121f736..349227c4da 100755
--- a/plugins/MetaContacts/src/meta_services.cpp
+++ b/plugins/MetaContacts/src/meta_services.cpp
@@ -261,13 +261,8 @@ INT_PTR MetaFilter_SendMessage(WPARAM wParam,LPARAM lParam)
INT_PTR Meta_SendNudge(WPARAM wParam,LPARAM lParam)
{
- HANDLE hMeta = (HANDLE)wParam, hSubContact = Meta_GetMostOnline(hMeta);
-
- char servicefunction[ 100 ];
- char *protoName = GetContactProto(hSubContact);
- sprintf(servicefunction, "%s/SendNudge", protoName);
-
- return CallService(servicefunction, (WPARAM)hSubContact, lParam);
+ HANDLE hSubContact = Meta_GetMostOnline((HANDLE)wParam);
+ return ProtoCallService(GetContactProto(hSubContact), "/SendNudge", (WPARAM)hSubContact, lParam);
}
/////////////////////////////////////////////////////////////////
diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp
index 0b8d8f3f13..19d1daf1ac 100644
--- a/plugins/SeenPlugin/src/utils.cpp
+++ b/plugins/SeenPlugin/src/utils.cpp
@@ -506,18 +506,18 @@ void myPlaySound(HANDLE hcontact, WORD newStatus, WORD oldStatus)
{
if (CallService(MS_IGNORE_ISIGNORED,(WPARAM)hcontact,IGNOREEVENT_USERONLINE)) return;
//oldStatus and hcontact are not used yet
- char * soundname=0;
- if ((newStatus==ID_STATUS_ONLINE) || (newStatus==ID_STATUS_FREECHAT)) soundname = "LastSeenTrackedStatusOnline";
- else if (newStatus==ID_STATUS_OFFLINE) soundname = "LastSeenTrackedStatusOffline";
- else if (oldStatus==ID_STATUS_OFFLINE) soundname = "LastSeenTrackedStatusFromOffline";
+ char *soundname = NULL;
+ if ((newStatus == ID_STATUS_ONLINE) || (newStatus == ID_STATUS_FREECHAT)) soundname = "LastSeenTrackedStatusOnline";
+ else if (newStatus == ID_STATUS_OFFLINE) soundname = "LastSeenTrackedStatusOffline";
+ else if (oldStatus == ID_STATUS_OFFLINE) soundname = "LastSeenTrackedStatusFromOffline";
else soundname = "LastSeenTrackedStatusChange";
- if (soundname!=0) SkinPlaySound(soundname);
+ if (soundname != NULL)
+ SkinPlaySound(soundname);
}
//will add hContact to queue and will return position;
static logthread_info* addContactToQueue(HANDLE hContact)
{
- int i = 0;
if (!hContact)
return NULL;
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp
index 4ed5023499..0a3f28e6d6 100644
--- a/plugins/TabSRMM/src/msgdlgutils.cpp
+++ b/plugins/TabSRMM/src/msgdlgutils.cpp
@@ -2175,10 +2175,7 @@ void TSAPI EnableSendButton(const TWindowData *dat, int iMode)
void TSAPI SendNudge(const TWindowData *dat)
{
- char szServiceName[128];
-
- mir_snprintf(szServiceName, 128, "%s/SendNudge", dat->cache->getActiveProto());
- if (ServiceExists(szServiceName) && ServiceExists(MS_NUDGE_SEND))
+ if ( ProtoServiceExists(dat->cache->getActiveProto(), "/SendNudge") && ServiceExists(MS_NUDGE_SEND))
CallService(MS_NUDGE_SEND, (WPARAM)dat->cache->getActiveContact(), 0);
else
SendMessage(dat->hwnd, DM_ACTIVATETOOLTIP, IDC_MESSAGE,
diff --git a/protocols/IRCG/src/clist.cpp b/protocols/IRCG/src/clist.cpp
index 3c3c0de534..878faa9ec0 100644
--- a/protocols/IRCG/src/clist.cpp
+++ b/protocols/IRCG/src/clist.cpp
@@ -72,9 +72,9 @@ BOOL CIrcProto::CList_AddDCCChat(const CMString& name, const CMString& hostmask,
cle.hDbEvent = (HANDLE)"dccchat";
cle.flags = CLEF_TCHAR;
cle.hIcon = LoadIconEx(IDI_DCC);
- mir_snprintf( szService, sizeof(szService),"%s/DblClickEvent", m_szModuleName);
- cle.pszService = szService ;
- mir_sntprintf( szNick, SIZEOF(szNick), TranslateT("CTCP chat request from %s"), name.c_str());
+ mir_snprintf(szService, sizeof(szService),"%s/DblClickEvent", m_szModuleName);
+ cle.pszService = szService;
+ mir_sntprintf(szNick, SIZEOF(szNick), TranslateT("CTCP chat request from %s"), name.c_str());
cle.ptszTooltip = szNick;
cle.lParam = (LPARAM)pdci;
diff --git a/src/modules/clist/clistmenus.cpp b/src/modules/clist/clistmenus.cpp
index 4222f2d6ed..76f65f5601 100644
--- a/src/modules/clist/clistmenus.cpp
+++ b/src/modules/clist/clistmenus.cpp
@@ -311,12 +311,8 @@ static INT_PTR AddContactMenuItem(WPARAM, LPARAM lParam)
mir_snprintf(buf, SIZEOF(buf), "%s/%s", (mi->pszContactOwner) ? mi->pszContactOwner : "", (mi->pszService) ? mi->pszService : "");
else if (mi->ptszName)
{
- if (tmi.flags&CMIF_UNICODE)
- {
- char * temp = mir_t2a(mi->ptszName);
- mir_snprintf(buf, SIZEOF(buf), "%s/NoService/%s", (mi->pszContactOwner) ? mi->pszContactOwner : "", temp);
- mir_free(temp);
- }
+ if (tmi.flags & CMIF_UNICODE)
+ mir_snprintf(buf, SIZEOF(buf), "%s/NoService/%s", (mi->pszContactOwner) ? mi->pszContactOwner : "", _T2A(mi->ptszName));
else
mir_snprintf(buf, SIZEOF(buf), "%s/NoService/%s", (mi->pszContactOwner) ? mi->pszContactOwner : "", mi->ptszName);
}