diff options
Diffstat (limited to 'plugins')
62 files changed, 113 insertions, 129 deletions
diff --git a/plugins/AVS/src/poll.cpp b/plugins/AVS/src/poll.cpp index 940d44f184..03135f35d2 100644 --- a/plugins/AVS/src/poll.cpp +++ b/plugins/AVS/src/poll.cpp @@ -75,7 +75,7 @@ void UninitPolls() static BOOL PollProtocolCanHaveAvatar(const char *szProto)
{
int pCaps = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0);
- int status = CallProtoService(szProto, PS_GETSTATUS, 0, 0);
+ int status = Proto_GetStatus(szProto);
return (pCaps & PF4_AVATARS) && mir_strcmp(META_PROTO, szProto) &&
((status > ID_STATUS_OFFLINE && status != ID_STATUS_INVISIBLE) || Proto_IsFetchingWhenProtoNotVisibleAllowed(szProto));
}
diff --git a/plugins/AutoShutdown/src/watcher.cpp b/plugins/AutoShutdown/src/watcher.cpp index 876d3a568e..9c55326902 100644 --- a/plugins/AutoShutdown/src/watcher.cpp +++ b/plugins/AutoShutdown/src/watcher.cpp @@ -178,7 +178,7 @@ static BOOL CheckAllContactsOffline(void) fSmartCheck = db_get_b(NULL, "AutoShutdown", "SmartOfflineCheck", SETTING_SMARTOFFLINECHECK_DEFAULT);
for (auto &hContact : Contacts()) {
char *pszProto = GetContactProto(hContact);
- if (pszProto != nullptr && CallProtoService(pszProto, PS_GETSTATUS, 0, 0) != ID_STATUS_OFFLINE) {
+ if (pszProto != nullptr && Proto_GetStatus(pszProto) != ID_STATUS_OFFLINE) {
if (db_get_b(hContact, pszProto, "ChatRoom", 0)) continue;
if (db_get_w(hContact, pszProto, "Status", 0) != ID_STATUS_OFFLINE) {
if (fSmartCheck) {
@@ -235,7 +235,7 @@ static BOOL CALLBACK CpuUsageWatcherProc(BYTE nCpuUsage, LPARAM lParam) static int WeatherUpdated(WPARAM wParam, LPARAM lParam)
{
char *pszProto = GetContactProto(wParam);
- if ((BOOL)lParam && pszProto != nullptr && CallProtoService(pszProto, PS_GETSTATUS, 0, 0) == THUNDER)
+ if ((BOOL)lParam && pszProto != nullptr && Proto_GetStatus(pszProto) == THUNDER)
if (db_get_b(NULL, "AutoShutdown", "WeatherShutdown", SETTING_WEATHERSHUTDOWN_DEFAULT))
ServiceShutdown(SDSDT_SHUTDOWN, TRUE);
return 0;
diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp index eabb2d137b..cbfca55369 100644 --- a/plugins/BossKeyPlus/src/BossKey.cpp +++ b/plugins/BossKeyPlus/src/BossKey.cpp @@ -209,7 +209,7 @@ static int ChangeAllProtoStatuses(unsigned statusMode, wchar_t *msg) {
for (int i = 0; i < protoCount; i++)
{
- unsigned status = CallProtoService(proto[i]->szModuleName, PS_GETSTATUS, 0, 0);
+ unsigned status = Proto_GetStatus(proto[i]->szModuleName);
if (
(g_wMask & OPT_ONLINEONLY) ? // check "Change only if current status is Online" option
((status == ID_STATUS_ONLINE) || (status == ID_STATUS_FREECHAT)) // process only "online" and "free for chat"
diff --git a/plugins/BuddyPounce/src/main.cpp b/plugins/BuddyPounce/src/main.cpp index 0f8e9fe5af..cc8e31c67e 100644 --- a/plugins/BuddyPounce/src/main.cpp +++ b/plugins/BuddyPounce/src/main.cpp @@ -159,7 +159,7 @@ int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam) DBVARIANT dbv;
if (!db_get_ws(hContact, modname, "PounceMsg", &dbv) && (dbv.ptszVal[0] != '\0')) {
// check my status
- if (statusCheck(db_get_w(hContact, modname, "SendIfMyStatusIsFLAG", 0), CallProtoService(szProto, PS_GETSTATUS,0,0))
+ if (statusCheck(db_get_w(hContact, modname, "SendIfMyStatusIsFLAG", 0), Proto_GetStatus(szProto))
// check the contacts status
&& statusCheck(db_get_w(hContact, modname, "SendIfTheirStatusIsFLAG", 0), newStatus)) {
// check if we r giving up after x days
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp index 5fc46485f4..3f6800fbfb 100644 --- a/plugins/Clist_modern/src/modern_clisttray.cpp +++ b/plugins/Clist_modern/src/modern_clisttray.cpp @@ -405,22 +405,22 @@ int cliTrayCalcChanged(const char *szChangedProto, int, int) if (szProto == nullptr)
break;
- iStatus = CallProtoService(szProto, PS_GETSTATUS, 0, 0);
+ iStatus = Proto_GetStatus(szProto);
if (g_StatusBarData.bConnectingIcon && IsStatusConnecting(iStatus))
hIcon = (HICON)CLUI_GetConnectingIconService((WPARAM)szProto, 0);
else
- hIcon = pcli->pfnGetIconFromStatusMode(0, szProto, CallProtoService(szProto, PS_GETSTATUS, 0, 0));
+ hIcon = pcli->pfnGetIconFromStatusMode(0, szProto, Proto_GetStatus(szProto));
Clist_TrayIconMakeTooltip(nullptr, szProto);
}
break;
case TRAY_ICON_MODE_CYCLE:
- iStatus = CallProtoService(szChangedProto, PS_GETSTATUS, 0, 0);
+ iStatus = Proto_GetStatus(szChangedProto);
if (g_StatusBarData.bConnectingIcon && IsStatusConnecting(iStatus))
hIcon = (HICON)CLUI_GetConnectingIconService((WPARAM)szChangedProto, 0);
else if (!bConn)
- hIcon = pcli->pfnGetIconFromStatusMode(0, szChangedProto, CallProtoService(szChangedProto, PS_GETSTATUS, 0, 0));
+ hIcon = pcli->pfnGetIconFromStatusMode(0, szChangedProto, Proto_GetStatus(szChangedProto));
Clist_TrayIconMakeTooltip(nullptr, nullptr);
break;
@@ -430,11 +430,11 @@ int cliTrayCalcChanged(const char *szChangedProto, int, int) if (!mir_strcmp(pcli->trayIcon[i].szProto, szChangedProto))
break;
- iStatus = CallProtoService(szChangedProto, PS_GETSTATUS, 0, 0);
+ iStatus = Proto_GetStatus(szChangedProto);
if (g_StatusBarData.bConnectingIcon && IsStatusConnecting(iStatus))
hIcon = (HICON)CLUI_GetConnectingIconService((WPARAM)szChangedProto, 0);
else
- hIcon = pcli->pfnGetIconFromStatusMode(0, szChangedProto, CallProtoService(szChangedProto, PS_GETSTATUS, 0, 0));
+ hIcon = pcli->pfnGetIconFromStatusMode(0, szChangedProto, Proto_GetStatus(szChangedProto));
Clist_TrayIconMakeTooltip(nullptr, pcli->trayIcon[i].szProto);
break;
}
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 6d3c0f0027..ac15e77b45 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -1946,7 +1946,7 @@ LRESULT CLUI::OnStatusBarUpdateTimer(UINT msg, WPARAM wParam, LPARAM lParam) if (pt->bGlobal)
status = g_bMultiConnectionMode ? ID_STATUS_CONNECTING : 0;
else
- status = CallProtoService(pt->szProto, PS_GETSTATUS, 0, 0);
+ status = Proto_GetStatus(pt->szProto);
if (!IsStatusConnecting(status)) {
pt->nCycleStartTick = 0;
diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp index c83617b732..02fe347366 100644 --- a/plugins/Clist_modern/src/modern_statusbar.cpp +++ b/plugins/Clist_modern/src/modern_statusbar.cpp @@ -232,7 +232,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) p->PaddingRight = 0;
}
- p->iProtoStatus = CallProtoService(szProto, PS_GETSTATUS, 0, 0);
+ p->iProtoStatus = Proto_GetStatus(szProto);
if (p->iProtoStatus > ID_STATUS_OFFLINE)
if (p->bShowProtoEmails == 1 && ProtoServiceExists(szProto, PS_GETUNREADEMAILCOUNT)) {
diff --git a/plugins/Clist_nicer/src/clisttray.cpp b/plugins/Clist_nicer/src/clisttray.cpp index f17dcb99ba..0b16733917 100644 --- a/plugins/Clist_nicer/src/clisttray.cpp +++ b/plugins/Clist_nicer/src/clisttray.cpp @@ -62,7 +62,7 @@ int TrayCalcChanged(const char *szChangedProto, int averageMode, int netProtoCou switch (db_get_b(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT)) {
case SETTING_TRAYICON_CYCLE:
Clist_TraySetTimer();
- iIcon = IconFromStatusMode(szChangedProto, CallProtoService(szChangedProto, PS_GETSTATUS, 0, 0), 0, &hIcon);
+ iIcon = IconFromStatusMode(szChangedProto, Proto_GetStatus(szChangedProto), 0, &hIcon);
hIcon = (hIcon) ? CopyIcon(hIcon) : ImageList_GetIcon(hCListImages, iIcon, ILD_NORMAL);
return Clist_TrayIconSetBaseInfo(hIcon, nullptr);
@@ -70,7 +70,7 @@ int TrayCalcChanged(const char *szChangedProto, int averageMode, int netProtoCou if (!pcli->trayIcon)
Clist_TrayIconRemove(nullptr, nullptr);
else if (db_get_b(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT)) {
- iIcon = IconFromStatusMode(szChangedProto, CallProtoService(szChangedProto, PS_GETSTATUS, 0, 0), 0, &hIcon);
+ iIcon = IconFromStatusMode(szChangedProto, Proto_GetStatus(szChangedProto), 0, &hIcon);
hIcon = (hIcon) ? CopyIcon(hIcon) : ImageList_GetIcon(hCListImages, iIcon, ILD_NORMAL);
return Clist_TrayIconSetBaseInfo(hIcon, szChangedProto);
}
@@ -80,7 +80,7 @@ int TrayCalcChanged(const char *szChangedProto, int averageMode, int netProtoCou case SETTING_TRAYICON_SINGLE:
ptrA szProto(db_get_sa(NULL, "CList", "PrimaryStatus"));
- iIcon = IconFromStatusMode(szProto, szProto ? CallProtoService(szProto, PS_GETSTATUS, 0, 0) : CallService(MS_CLIST_GETSTATUSMODE, 0, 0), 0, &hIcon);
+ iIcon = IconFromStatusMode(szProto, szProto ? Proto_GetStatus(szProto) : CallService(MS_CLIST_GETSTATUSMODE, 0, 0), 0, &hIcon);
hIcon = (hIcon) ? CopyIcon(hIcon) : ImageList_GetIcon(hCListImages, iIcon, ILD_NORMAL);
return Clist_TrayIconSetBaseInfo(hIcon, nullptr);
}
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 9df0da77e5..8346228903 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -1638,7 +1638,7 @@ buttons_done: SIZE textSize; BYTE showOpts = db_get_b(NULL, "CLUI", "SBarShow", 1); char *szProto = pd->RealName; - int status = CallProtoService(szProto, PS_GETSTATUS, 0, 0); + int status = Proto_GetStatus(szProto); SetBkMode(dis->hDC, TRANSPARENT); int x = dis->rcItem.left; diff --git a/plugins/Clist_nicer/src/cluiservices.cpp b/plugins/Clist_nicer/src/cluiservices.cpp index 512917ed51..7da688f714 100644 --- a/plugins/Clist_nicer/src/cluiservices.cpp +++ b/plugins/Clist_nicer/src/cluiservices.cpp @@ -167,10 +167,10 @@ void CluiProtocolStatusChanged(int, const char*) }
// update the clui button
- WORD wStatus = 0;
+ int wStatus = 0;
if (!db_get(NULL, "CList", "PrimaryStatus", &dbv)) {
if (dbv.type == DBVT_ASCIIZ && mir_strlen(dbv.pszVal) > 1) {
- wStatus = (WORD)CallProtoService(dbv.pszVal, PS_GETSTATUS, 0, 0);
+ wStatus = Proto_GetStatus(dbv.pszVal);
iIcon = IconFromStatusMode(dbv.pszVal, (int)wStatus, 0, &hIcon);
}
mir_free(dbv.pszVal);
diff --git a/plugins/Clist_nicer/src/statusbar.cpp b/plugins/Clist_nicer/src/statusbar.cpp index d1e1789c81..c8b5d443ed 100644 --- a/plugins/Clist_nicer/src/statusbar.cpp +++ b/plugins/Clist_nicer/src/statusbar.cpp @@ -155,12 +155,11 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM if (NotifyEventHooks(hStatusBarShowToolTipEvent, (WPARAM)PD->RealName, 0) > 0) // a plugin handled this event
tooltip_active = TRUE;
else if (db_get_dw(NULL, "mToolTip", "ShowStatusTip", 0)) {
- WORD wStatus = (WORD)CallProtoService(PD->RealName, PS_GETSTATUS, 0, 0);
+ int wStatus = Proto_GetStatus(PD->RealName);
BYTE isLocked = db_get_b(NULL, PD->RealName, "LockMainStatus", 0);
wchar_t szTipText[256];
- mir_snwprintf(szTipText, L"<b>%s</b>: %s%s",
- PD->RealName, Clist_GetStatusModeDescription(wStatus, 0), isLocked ? L" (LOCKED)" : L"");
+ mir_snwprintf(szTipText, L"<b>%s</b>: %s%s", PD->RealName, Clist_GetStatusModeDescription(wStatus, 0), isLocked ? L" (LOCKED)" : L"");
CLCINFOTIP ti = { sizeof(ti) };
ti.isTreeFocused = (GetFocus() == pcli->hwndContactList);
diff --git a/plugins/CloudFile/src/utils.cpp b/plugins/CloudFile/src/utils.cpp index b2a515fe94..27ff876b19 100644 --- a/plugins/CloudFile/src/utils.cpp +++ b/plugins/CloudFile/src/utils.cpp @@ -49,7 +49,7 @@ bool CanSendToContact(MCONTACT hContact) if (!canSend) return false; - bool isProtoOnline = CallProtoService(proto, PS_GETSTATUS, 0, 0) > ID_STATUS_OFFLINE; + bool isProtoOnline = Proto_GetStatus(proto) > ID_STATUS_OFFLINE; if (isProtoOnline) return true; diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp index c343412f4e..b24ef0eaba 100644 --- a/plugins/CmdLine/src/mimcmd_handlers.cpp +++ b/plugins/CmdLine/src/mimcmd_handlers.cpp @@ -202,7 +202,7 @@ void HandleStatusCommand(PCommand command, TArgument *argv, int argc, PReply rep for (auto &pa : Accounts()) {
if (pa->bIsEnabled) {
- status = CallProtoService(pa->szModuleName, PS_GETSTATUS, 0, 0);
+ status = Proto_GetStatus(pa->szModuleName);
PrettyStatusMode(status, pn, _countof(pn));
perAccountStatus.AppendChar('\n');
@@ -246,7 +246,7 @@ void HandleStatusCommand(PCommand command, TArgument *argv, int argc, PReply rep wchar_t *account = argv[3];
AccountName2Protocol(account, protocol, _countof(protocol));
- INT_PTR old = CallProtoService(protocol, PS_GETSTATUS, 0, 0);
+ int old = Proto_GetStatus(protocol);
wchar_t po[128];
if (ServiceExists(MS_KS_ANNOUNCESTATUSCHANGE)) {
announce_status_change(protocol, status, nullptr);
@@ -300,7 +300,7 @@ void HandleAwayMsgCommand(PCommand command, TArgument *argv, int argc, PReply re char *protocol = pa->szModuleName;
if ((CallProtoService(protocol, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND) != 0) { //if the protocol supports away messages
- INT_PTR status = CallProtoService(protocol, PS_GETSTATUS, 0, 0);
+ int status = Proto_GetStatus(protocol);
INT_PTR res = CallProtoService(protocol, PS_SETAWAYMSG, status, (LPARAM)awayMsg);
wchar_t pn[128];
@@ -328,14 +328,11 @@ void HandleAwayMsgCommand(PCommand command, TArgument *argv, int argc, PReply re INT_PTR res = CallProtoService(protocol, PS_GETCAPS, PFLAGNUM_1, 0);
if ((res & PF1_MODEMSGSEND) != 0) //if the protocol supports away messages
{
- INT_PTR status = CallProtoService(protocol, PS_GETSTATUS, 0, 0);
+ int status = Proto_GetStatus(protocol);
res = CallProtoService(protocol, PS_SETAWAYMSG, status, (LPARAM)awayMsg);
PrettyStatusMode(status, pn, _countof(pn));
}
- else if (CallProtoService(protocol, PS_GETSTATUS, 0, 0) == CALLSERVICE_NOTFOUND) {
- res = CALLSERVICE_NOTFOUND;
- }
else {
res = -2;
}
@@ -346,11 +343,6 @@ void HandleAwayMsgCommand(PCommand command, TArgument *argv, int argc, PReply re mir_snwprintf(reply->message, TranslateT("Changed '%s' status message to '%s' (status is '%s')."), account, awayMsg, pn);
return;
- case CALLSERVICE_NOTFOUND:
- reply->code = MIMRES_FAILURE;
- mir_snwprintf(reply->message, TranslateT("'%s' doesn't seem to be a valid account."), account);
- return;
-
case -2:
reply->code = MIMRES_FAILURE;
mir_snwprintf(reply->message, TranslateT("Account '%s' does not support away messages, skipping."), account);
diff --git a/plugins/FloatingContacts/src/thumbs.cpp b/plugins/FloatingContacts/src/thumbs.cpp index 33c49626f9..0c2a2e2b73 100644 --- a/plugins/FloatingContacts/src/thumbs.cpp +++ b/plugins/FloatingContacts/src/thumbs.cpp @@ -247,7 +247,7 @@ void ThumbInfo::ResizeThumb() if (!db_get_b(hContact, "CList", "NotOnList", 0)) {
char *szProto = GetContactProto(hContact);
if (nullptr != szProto) {
- int nStatus = CallProtoService(szProto, PS_GETSTATUS, 0, 0);
+ int nStatus = Proto_GetStatus(szProto);
int nContactStatus = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
int nApparentMode = db_get_w(hContact, szProto, "ApparentMode", 0);
@@ -575,7 +575,7 @@ void ThumbInfo::UpdateContent() if (!db_get_b(hContact, "CList", "NotOnList", 0)) {
char *szProto = GetContactProto(hContact);
if (nullptr != szProto) {
- int nStatus = CallProtoService(szProto, PS_GETSTATUS, 0, 0);
+ int nStatus = Proto_GetStatus(szProto);
int nContactStatus = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
int nApparentMode = db_get_w(hContact, szProto, "ApparentMode", 0);
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index 71575ed798..305a817183 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -366,7 +366,7 @@ BOOL checkStatus(char *szProto) if (!szProto)
return checkGlobalStatus();
- return isStatusEnabled(CallProtoService(szProto, PS_GETSTATUS, 0, 0));
+ return isStatusEnabled(Proto_GetStatus(szProto));
}
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp index 1873a51419..d57cdb86bf 100644 --- a/plugins/ListeningTo/src/listeningto.cpp +++ b/plugins/ListeningTo/src/listeningto.cpp @@ -609,7 +609,7 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti = nullptr) }
}
else if (db_get_b(0, MODULE_NAME, "UseStatusMessage", 1) && ProtoServiceExists(proto, PS_SETAWAYMSG)) {
- int status = CallProtoService(proto, PS_GETSTATUS, 0, 0);
+ int status = Proto_GetStatus(proto);
if (lti == nullptr)
CallProtoService(proto, PS_SETAWAYMSG, status, 0);
else {
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index c322ef8006..29a0aa89df 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -406,7 +406,7 @@ static INT_PTR CALLBACK AuthReqWndProc(HWND hdlg, UINT msg, WPARAM wparam, LPARA static BOOL isProtoOnline(char *szProto)
{
- DWORD protoStatus = CallProtoService(szProto, PS_GETSTATUS, 0, 0);
+ int protoStatus = Proto_GetStatus(szProto);
return (protoStatus > ID_STATUS_OFFLINE && protoStatus < ID_STATUS_IDLE);
}
diff --git a/plugins/MirFox/src/MirandaUtils.cpp b/plugins/MirFox/src/MirandaUtils.cpp index f4845deb7e..233b45be76 100644 --- a/plugins/MirFox/src/MirandaUtils.cpp +++ b/plugins/MirFox/src/MirandaUtils.cpp @@ -372,7 +372,7 @@ int MirandaUtils::on_hook_OpenMW(WPARAM wParam, LPARAM lParam) void MirandaUtils::setStatusOnAccount(ActionThreadArgStruct* args)
{
logger->log(L"MirandaUtils::setStatusOnAccount: start");
- int status = CallProtoService(args->accountSzModuleName, PS_GETSTATUS, 0, 0);
+ int status = Proto_GetStatus(args->accountSzModuleName);
logger->log_p(L"SSOA: on account: [%S] targetHandle = [" SCNuPTR L"] at status = [%d]", args->accountSzModuleName, args->targetHandle, status);
INT_PTR result = -1;
diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp index acc7bf0a3e..4b9692dd87 100644 --- a/plugins/MirandaG15/src/CAppletManager.cpp +++ b/plugins/MirandaG15/src/CAppletManager.cpp @@ -722,7 +722,7 @@ void CAppletManager::SendTypingNotification(MCONTACT hContact, bool bEnable) if (!(typeCaps & PF4_SUPPORTTYPING)) return; - DWORD protoStatus = CallProtoService(szProto, PS_GETSTATUS, 0, 0); + DWORD protoStatus = Proto_GetStatus(szProto); if (protoStatus < ID_STATUS_ONLINE) return; diff --git a/plugins/MyDetails/src/data.cpp b/plugins/MyDetails/src/data.cpp index a536eaea5d..8dda970f0a 100644 --- a/plugins/MyDetails/src/data.cpp +++ b/plugins/MyDetails/src/data.cpp @@ -93,14 +93,11 @@ bool Protocol::IsValid() int Protocol::GetStatus()
{
- INT_PTR iStatus = CallProtoService(name, PS_GETSTATUS, 0, 0);
- if (iStatus == CALLSERVICE_NOTFOUND)
- return status = ID_STATUS_OFFLINE;
-
+ int iStatus = Proto_GetStatus(name);
if (iStatus != status)
data_changed = true;
- status = (int)iStatus;
+ status = iStatus;
// check if protocol supports custom status
CUSTOM_STATUS css = { sizeof(css) };
diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp index a88cec226b..a29cfd136d 100644 --- a/plugins/NewAwaySysMod/src/AwaySys.cpp +++ b/plugins/NewAwaySysMod/src/AwaySys.cpp @@ -302,7 +302,7 @@ static int IdleChangeEvent(WPARAM, LPARAM lParam) int PreBuildContactMenu(WPARAM hContact, LPARAM)
{
char *szProto = GetContactProto(hContact);
- int iMode = szProto ? CallProtoService(szProto, PS_GETSTATUS, 0, 0) : 0;
+ int iMode = szProto ? Proto_GetStatus(szProto) : 0;
int Flag1 = szProto ? CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) : 0;
int iContactMode = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
wchar_t szSetStr[256], szReadStr[256];
diff --git a/plugins/NewAwaySysMod/src/Client.cpp b/plugins/NewAwaySysMod/src/Client.cpp index 814823e178..661385e298 100644 --- a/plugins/NewAwaySysMod/src/Client.cpp +++ b/plugins/NewAwaySysMod/src/Client.cpp @@ -36,7 +36,7 @@ void __cdecl UpdateMsgsThreadProc(void *) DWORD MinUpdateTimeDifference = (DWORD)g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_UPDATEMSGSPERIOD) * 1000; // in milliseconds
for (auto &p : Accounts()) {
if (CallProtoService(p->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND && !IsAnICQProto(p->szModuleName)) {
- int Status = CallProtoService(p->szModuleName, PS_GETSTATUS, 0, 0);
+ int Status = Proto_GetStatus(p->szModuleName);
if (Status < ID_STATUS_OFFLINE || Status > ID_STATUS_OUTTOLUNCH) {
Status = g_ProtoStates[p->szModuleName].m_status;
}
diff --git a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp index 0f71f63661..266437ea13 100644 --- a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp +++ b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp @@ -165,7 +165,7 @@ int MsgEventAdded(WPARAM hContact, LPARAM lParam) return 0;
}
- int iMode = CallProtoService(szProto, PS_GETSTATUS, 0, 0);
+ int iMode = Proto_GetStatus(szProto);
int i;
for (i = _countof(StatusModeList) - 1; i >= 0; i--)
if (iMode == StatusModeList[i].Status)
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index edf5edcdb2..60649d6deb 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -369,7 +369,7 @@ int ContactStatusChanged(MCONTACT hContact, WORD oldStatus, WORD newStatus) bool bEnablePopup = true, bEnableSound = true;
char *szProto = GetContactProto(hContact);
- WORD myStatus = (WORD)CallProtoService(szProto, PS_GETSTATUS, 0, 0);
+ int myStatus = Proto_GetStatus(szProto);
if (!mir_strcmp(szProto, META_PROTO)) { //this contact is Meta
MCONTACT hSubContact = db_mc_getMostOnline(hContact);
@@ -419,7 +419,7 @@ int ContactStatusChanged(MCONTACT hContact, WORD oldStatus, WORD newStatus) }
if (bEnablePopup && db_get_b(hContact, MODULE, "EnablePopups", 1) && !opt.TempDisabled) {
- WORD wStatus = (WORD)CallProtoService(szProto, PS_GETSTATUS, 0, 0);
+ int wStatus = Proto_GetStatus(szProto);
wchar_t str[MAX_SECONDLINE] = { 0 };
if (opt.ShowStatus)
GetStatusText(hContact, newStatus, oldStatus, str);
@@ -641,7 +641,7 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact) bEnableSound = bEnablePopup = false;
// we're offline or just connecting
- WORD myStatus = (WORD)CallProtoService(szProto, PS_GETSTATUS, 0, 0);
+ int myStatus = Proto_GetStatus(szProto);
if (myStatus == ID_STATUS_OFFLINE)
goto skip_notify;
diff --git a/plugins/NewXstatusNotify/src/popup.cpp b/plugins/NewXstatusNotify/src/popup.cpp index a0062327b3..a570cd7646 100644 --- a/plugins/NewXstatusNotify/src/popup.cpp +++ b/plugins/NewXstatusNotify/src/popup.cpp @@ -188,7 +188,7 @@ LRESULT CALLBACK PopupDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa if (pdp != nullptr) {
char *szProto = GetContactProto(PUGetContact(hwnd));
if (szProto && opt.ReadAwayMsg && StatusHasAwayMessage(szProto, pdp->newStatus)) {
- WORD myStatus = (WORD)CallProtoService(szProto, PS_GETSTATUS, 0, 0);
+ int myStatus = Proto_GetStatus(szProto);
if (myStatus != ID_STATUS_INVISIBLE)
QueryAwayMessage(hwnd, pdp);
}
diff --git a/plugins/NewXstatusNotify/src/xstatus.cpp b/plugins/NewXstatusNotify/src/xstatus.cpp index 6bcc4a7b05..4c73abb6f9 100644 --- a/plugins/NewXstatusNotify/src/xstatus.cpp +++ b/plugins/NewXstatusNotify/src/xstatus.cpp @@ -351,7 +351,7 @@ void ExtraStatusChanged(XSTATUSCHANGE *xsc) if ((db_get_b(0, MODULE, buff, 1) == 0)
|| (db_get_w(xsc->hContact, xsc->szProto, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE)
|| (!opt.HiddenContactsToo && (db_get_b(xsc->hContact, "CList", "Hidden", 0) == 1))
- || (CallProtoService(xsc->szProto, PS_GETSTATUS, 0, 0) == ID_STATUS_OFFLINE))
+ || (Proto_GetStatus(xsc->szProto) == ID_STATUS_OFFLINE))
{
FreeXSC(xsc);
return;
@@ -364,7 +364,7 @@ void ExtraStatusChanged(XSTATUSCHANGE *xsc) // check if our status isn't on autodisable list
if (opt.AutoDisable) {
char statusIDs[12], statusIDp[12];
- WORD myStatus = (WORD)CallProtoService(xsc->szProto, PS_GETSTATUS, 0, 0);
+ int myStatus = Proto_GetStatus(xsc->szProto);
mir_snprintf(statusIDs, "s%d", myStatus);
mir_snprintf(statusIDp, "p%d", myStatus);
bEnableSound = db_get_b(0, MODULE, statusIDs, 1) ? FALSE : bEnableSound;
diff --git a/plugins/NewsAggregator/Src/Options.cpp b/plugins/NewsAggregator/Src/Options.cpp index bf3b9f77fc..b84aabe6a2 100644 --- a/plugins/NewsAggregator/Src/Options.cpp +++ b/plugins/NewsAggregator/Src/Options.cpp @@ -606,7 +606,7 @@ void CImportFeed::OnOk(CCtrlBase*) db_set_b(hContact, MODULE, "CheckState", 1);
db_set_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME);
db_set_ws(hContact, MODULE, "MsgFormat", TAGSDEFAULT);
- db_set_w(hContact, MODULE, "Status", CallProtoService(MODULE, PS_GETSTATUS, 0, 0));
+ db_set_w(hContact, MODULE, "Status", Proto_GetStatus(MODULE));
if (m_list != nullptr) {
int iItem = m_list->AddItem(text, -1);
@@ -835,7 +835,7 @@ void CFeedEditor::OnOk(CCtrlBase*) db_set_ws(hContact, MODULE, "URL", strfeedurl);
db_set_dw(hContact, MODULE, "UpdateTime", (DWORD)m_checktime.GetInt());
db_set_ws(hContact, MODULE, "MsgFormat", strtagedit);
- db_set_w(hContact, MODULE, "Status", CallProtoService(MODULE, PS_GETSTATUS, 0, 0));
+ db_set_w(hContact, MODULE, "Status", Proto_GetStatus(MODULE));
if (m_useauth.IsChecked()) {
db_set_b(hContact, MODULE, "UseAuth", 1);
db_set_ws(hContact, MODULE, "Login", m_login.GetText());
diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp index 3712093624..4770a71d76 100644 --- a/plugins/Nudge/src/main.cpp +++ b/plugins/Nudge/src/main.cpp @@ -104,7 +104,7 @@ int NudgeReceived(WPARAM hContact, LPARAM lParam) if (p->useIgnoreSettings && CallService(MS_IGNORE_ISIGNORED, hContact, IGNOREEVENT_USERONLINE))
return 0;
- DWORD Status = CallProtoService(protoName, PS_GETSTATUS, 0, 0);
+ int Status = Proto_GetStatus(protoName);
if (((p->statusFlags & NUDGE_ACC_ST0) && (Status <= ID_STATUS_OFFLINE)) ||
((p->statusFlags & NUDGE_ACC_ST1) && (Status == ID_STATUS_ONLINE)) ||
diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp index 0b21f6aac7..080f044345 100644 --- a/plugins/Ping/src/pingthread.cpp +++ b/plugins/Ping/src/pingthread.cpp @@ -62,15 +62,13 @@ void SetProtoStatus(wchar_t *pszLabel, char *pszProto, int if_status, int new_st SetProtoStatus(pszLabel, pa->szModuleName, if_status, new_status);
}
else {
- if (ProtoServiceExists(pszProto, PS_GETSTATUS)) {
- if (CallProtoService(pszProto, PS_GETSTATUS, 0, 0) == if_status) {
- if (options.logging) {
- wchar_t buf[1024];
- mir_snwprintf(buf, TranslateT("%s - setting status of protocol '%S' (%d)"), pszLabel, pszProto, new_status);
- CallService(PLUG "/Log", (WPARAM)buf, 0);
- }
- CallProtoService(pszProto, PS_SETSTATUS, new_status, 0);
+ if (Proto_GetStatus(pszProto) == if_status) {
+ if (options.logging) {
+ wchar_t buf[1024];
+ mir_snwprintf(buf, TranslateT("%s - setting status of protocol '%S' (%d)"), pszLabel, pszProto, new_status);
+ CallService(PLUG "/Log", (WPARAM)buf, 0);
}
+ CallProtoService(pszProto, PS_SETSTATUS, new_status, 0);
}
}
}
diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp index e6f09614cc..d545d5ff9e 100644 --- a/plugins/Popup/src/services.cpp +++ b/plugins/Popup/src/services.cpp @@ -147,9 +147,9 @@ INT_PTR Popup_AddPopup2(WPARAM wParam, LPARAM lParam) if (proto) {
char prefix[128];
mir_snprintf(prefix, LPGEN("Protocol Status") "/%s", GetContactProto(ppd->lchContact));
- if (db_get_dw(NULL, MODULNAME, prefix, 0) & Proto_Status2Flag_My(CallProtoService(proto, PS_GETSTATUS, 0, 0)))
+ if (db_get_dw(NULL, MODULNAME, prefix, 0) & Proto_Status2Flag_My(Proto_GetStatus(proto)))
return -1;
- if (((disableWhen >> 16) & 0xFFFF0000) & Proto_Status2Flag_My(CallProtoService(proto, PS_GETSTATUS, 0, 0)))
+ if (((disableWhen >> 16) & 0xFFFF0000) & Proto_Status2Flag_My(Proto_GetStatus(proto)))
return -1;
}
}
diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp index 1addb3196b..a7330a36fc 100644 --- a/plugins/QuickContacts/src/quickcontacts.cpp +++ b/plugins/QuickContacts/src/quickcontacts.cpp @@ -345,8 +345,7 @@ void LoadContacts(HWND hwndDlg, BOOL show_all) continue;
// Check if proto offline
- else if (opts.hide_from_offline_proto
- && CallProtoService(pszProto, PS_GETSTATUS, 0, 0) <= ID_STATUS_OFFLINE)
+ else if (opts.hide_from_offline_proto && Proto_GetStatus(pszProto) <= ID_STATUS_OFFLINE)
continue;
}
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 9df51fc70c..020404d9ae 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -624,7 +624,7 @@ bool CSrmmWindow::IsTypingNotificationEnabled() if (!db_get_b(m_hContact, SRMM_MODULE, SRMSGSET_TYPING, db_get_b(0, SRMM_MODULE, SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW)))
return FALSE;
- DWORD protoStatus = CallProtoService(m_szProto, PS_GETSTATUS, 0, 0);
+ DWORD protoStatus = Proto_GetStatus(m_szProto);
if (protoStatus < ID_STATUS_ONLINE)
return FALSE;
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index 6bf42b4f49..3d6279ab5a 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -66,7 +66,7 @@ int IsAutoPopup(MCONTACT hContact) { if (hContact != 0)
szProto = GetContactProto(hContact);
- if (szProto && (g_dat.openFlags & SRMMStatusToPf2(CallProtoService(szProto, PS_GETSTATUS, 0, 0))))
+ if (szProto && (g_dat.openFlags & SRMMStatusToPf2(Proto_GetStatus(szProto))))
return 1;
}
return 0;
diff --git a/plugins/SecureIM/src/crypt_check.cpp b/plugins/SecureIM/src/crypt_check.cpp index 82dbb7ad1c..d85f9e0e2b 100644 --- a/plugins/SecureIM/src/crypt_check.cpp +++ b/plugins/SecureIM/src/crypt_check.cpp @@ -105,7 +105,7 @@ bool isContactInvisible(MCONTACT hContact) switch (db_get_w(hContact, p->proto->name, "ApparentMode", 0)) {
case 0:
- return CallProtoService(p->proto->name, PS_GETSTATUS, 0, 0) == ID_STATUS_INVISIBLE;
+ return Proto_GetStatus(p->proto->name) == ID_STATUS_INVISIBLE;
case ID_STATUS_ONLINE:
return false;
case ID_STATUS_OFFLINE:
diff --git a/plugins/SeenPlugin/src/missed.cpp b/plugins/SeenPlugin/src/missed.cpp index b378609f44..15fd50725d 100644 --- a/plugins/SeenPlugin/src/missed.cpp +++ b/plugins/SeenPlugin/src/missed.cpp @@ -163,7 +163,7 @@ int ModeChange_mo(WPARAM, LPARAM lparam) if (ack->type != ACKTYPE_STATUS || ack->result != ACKRESULT_SUCCESS || ack->hContact != NULL)
return 0;
- int isetting = CallProtoService(ack->szModule, PS_GETSTATUS, 0, 0);
+ int isetting = Proto_GetStatus(ack->szModule);
switch (isetting) {
case ID_STATUS_AWAY:
case ID_STATUS_DND:
diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index 3a0a2065e8..4d0a7a7eb5 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -595,7 +595,7 @@ int UpdateValues(WPARAM hContact, LPARAM lparam) FileWrite(hContact);
char *sProto = GetContactProto(hContact);
- if (CallProtoService(sProto, PS_GETSTATUS, 0, 0) > ID_STATUS_OFFLINE) {
+ if (Proto_GetStatus(sProto) > ID_STATUS_OFFLINE) {
myPlaySound(hContact, ID_STATUS_OFFLINE, prevStatus);
if (db_get_b(NULL, S_MOD, "UsePopups", 0))
ShowPopup(hContact, sProto, ID_STATUS_OFFLINE);
@@ -628,7 +628,7 @@ int UpdateValues(WPARAM hContact, LPARAM lparam) }
else if (hContact && IsWatchedProtocol(cws->szModule) && !db_get_b(hContact, cws->szModule, "ChatRoom", false)) {
// here we will come when <User>/<module>/Status is changed or it is idle event and if <module> is watched
- if (CallProtoService(cws->szModule, PS_GETSTATUS, 0, 0) > ID_STATUS_OFFLINE) {
+ if (Proto_GetStatus(cws->szModule) > ID_STATUS_OFFLINE) {
mir_cslock lck(csContacts);
logthread_info *p = arContacts.find((logthread_info*)&hContact);
if (p == nullptr) {
diff --git a/plugins/SimpleAR/src/Main.cpp b/plugins/SimpleAR/src/Main.cpp index 0ffc1ffefc..13bf7cd492 100644 --- a/plugins/SimpleAR/src/Main.cpp +++ b/plugins/SimpleAR/src/Main.cpp @@ -145,7 +145,7 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent) return FALSE; /// unspecifyed error
char* pszProto = GetContactProto(hContact);
- int status = CallProtoService(pszProto, PS_GETSTATUS, 0, 0);
+ int status = Proto_GetStatus(pszProto);
if (status == ID_STATUS_ONLINE || status == ID_STATUS_FREECHAT || status == ID_STATUS_INVISIBLE)
return FALSE;
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp index a450a61e73..1e01eb7936 100644 --- a/plugins/SimpleStatusMsg/src/main.cpp +++ b/plugins/SimpleStatusMsg/src/main.cpp @@ -1302,7 +1302,7 @@ VOID CALLBACK UpdateMsgTimerProc(HWND, UINT, UINT_PTR, DWORD) if (!(CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
continue;
- iCurrentStatus = CallProtoService(pa->szModuleName, PS_GETSTATUS, 0, 0);
+ iCurrentStatus = Proto_GetStatus(pa->szModuleName);
if (iCurrentStatus < ID_STATUS_ONLINE)
continue;
@@ -1471,7 +1471,7 @@ static int OnIdleChanged(WPARAM, LPARAM lParam) continue;
}
- int iCurrentStatus = CallProtoService(pa->szModuleName, PS_GETSTATUS, 0, 0);
+ int iCurrentStatus = Proto_GetStatus(pa->szModuleName);
if (iCurrentStatus < ID_STATUS_ONLINE || iCurrentStatus == ID_STATUS_INVISIBLE)
continue;
@@ -1509,7 +1509,7 @@ static int CSStatusChange(WPARAM wParam, LPARAM) if (ps[i]->m_status == ID_STATUS_IDLE)
status_mode = ps[i]->m_lastStatus;
else if (ps[i]->m_status == ID_STATUS_CURRENT)
- status_mode = CallProtoService(ps[i]->m_szName, PS_GETSTATUS, 0, 0);
+ status_mode = Proto_GetStatus(ps[i]->m_szName);
else
status_mode = ps[i]->m_status;
@@ -1770,7 +1770,7 @@ static int OnOkToExit(WPARAM, LPARAM) continue;
mir_snprintf(szSetting, "Last%sStatus", pa->szModuleName);
- db_set_w(NULL, "SimpleStatusMsg", szSetting, (WORD)CallProtoService(pa->szModuleName, PS_GETSTATUS, 0, 0));
+ db_set_w(NULL, "SimpleStatusMsg", szSetting, Proto_GetStatus(pa->szModuleName));
}
if (g_ptszWinampSong && mir_wstrcmp(g_ptszWinampSong, L"SimpleStatusMsg") /*&& db_get_b(NULL, "SimpleStatusMsg", "AmpLeaveTitle", 1)*/)
diff --git a/plugins/SkypeStatusChange/src/main.cpp b/plugins/SkypeStatusChange/src/main.cpp index a5c6fe37e1..819896be8f 100644 --- a/plugins/SkypeStatusChange/src/main.cpp +++ b/plugins/SkypeStatusChange/src/main.cpp @@ -98,7 +98,7 @@ int SSC_OnProtocolAck(WPARAM, LPARAM lParam) return 0;
if (!g_Options.IsProtocolExcluded(pAckData->szModule)) {
- int nStatus = CallProtoService(pAckData->szModule, PS_GETSTATUS, 0, 0);
+ int nStatus = Proto_GetStatus(pAckData->szModule);
for (size_t i = 0; i < _countof(g_aStatusCode); ++i) {
const CMirandaStatus2SkypeStatus& ms = g_aStatusCode[i];
if (ms.m_nMirandaStatus == nStatus) {
diff --git a/plugins/StatusChange/src/main.cpp b/plugins/StatusChange/src/main.cpp index 75f30ff4b5..350872570b 100644 --- a/plugins/StatusChange/src/main.cpp +++ b/plugins/StatusChange/src/main.cpp @@ -44,13 +44,12 @@ void LoadOptions() static int StatusChangeGetMessage(WPARAM, LPARAM hDbEvent)
{
- int status;
BOOL read, send, change_status;
DBEVENTINFO dbe = {};
db_event_get(hDbEvent, &dbe);
- status = (int)CallProtoService(dbe.szModule, PS_GETSTATUS, 0, 0);
+ int status = Proto_GetStatus(dbe.szModule);
if(!status)
status = CallService(MS_CLIST_GETSTATUSMODE, 0, 0);
diff --git a/plugins/StatusManager/src/AdvancedAutoAway/advancedautoaway.cpp b/plugins/StatusManager/src/AdvancedAutoAway/advancedautoaway.cpp index 96213f8cc7..5ca571ec9d 100644 --- a/plugins/StatusManager/src/AdvancedAutoAway/advancedautoaway.cpp +++ b/plugins/StatusManager/src/AdvancedAutoAway/advancedautoaway.cpp @@ -222,7 +222,7 @@ static VOID CALLBACK AutoAwayTimer(HWND, UINT, UINT_PTR, DWORD) int sts1Time = it->awayTime * SECS_PER_MINUTE; int sts2Time = it->naTime * SECS_PER_MINUTE; int sts1setTime = it->sts1setTimer == 0 ? 0 : (GetTickCount() - it->sts1setTimer) / 1000; - int currentMode = CallProtoService(it->m_szName, PS_GETSTATUS, 0, 0); + int currentMode = Proto_GetStatus(it->m_szName); if (it->optionFlags & FLAG_ONSAVER) bTrigger |= IsScreenSaverRunning(); @@ -235,7 +235,7 @@ static VOID CALLBACK AutoAwayTimer(HWND, UINT, UINT_PTR, DWORD) if (it->curState == ACTIVE) { if (((mouseStationaryTimer >= sts1Time && (it->optionFlags & FLAG_ONMOUSE)) || bTrigger) && currentMode != it->lv1Status && it->statusFlags&StatusModeToProtoFlag(currentMode)) { /* from ACTIVE to STATUS1_SET */ - it->m_lastStatus = it->originalStatusMode = CallProtoService(it->m_szName, PS_GETSTATUS, 0, 0); + it->m_lastStatus = it->originalStatusMode = Proto_GetStatus(it->m_szName); it->aaaStatus = it->lv1Status; it->sts1setTimer = GetTickCount(); sts1setTime = 0; @@ -244,7 +244,7 @@ static VOID CALLBACK AutoAwayTimer(HWND, UINT, UINT_PTR, DWORD) } else if (mouseStationaryTimer >= sts2Time && currentMode == it->lv1Status && currentMode != it->lv2Status && (it->optionFlags & FLAG_SETNA) && (it->statusFlags & StatusModeToProtoFlag(currentMode))) { /* from ACTIVE to STATUS2_SET */ - it->m_lastStatus = it->originalStatusMode = CallProtoService(it->m_szName, PS_GETSTATUS, 0, 0); + it->m_lastStatus = it->originalStatusMode = Proto_GetStatus(it->m_szName); it->aaaStatus = it->lv2Status; it->bStatusChanged = statusChanged = true; changeState(*it, STATUS2_SET); @@ -255,7 +255,7 @@ static VOID CALLBACK AutoAwayTimer(HWND, UINT, UINT_PTR, DWORD) if ((mouseStationaryTimer < sts1Time && !bTrigger) && !(it->optionFlags & FLAG_RESET)) { /* from STATUS1_SET to HIDDEN_ACTIVE */ changeState(*it, HIDDEN_ACTIVE); - it->m_lastStatus = CallProtoService(it->m_szName, PS_GETSTATUS, 0, 0); + it->m_lastStatus = Proto_GetStatus(it->m_szName); } else if (((mouseStationaryTimer < sts1Time) && !bTrigger) && ((it->optionFlags & FLAG_LV2ONINACTIVE) || (!(it->optionFlags&FLAG_SETNA))) && @@ -266,7 +266,7 @@ static VOID CALLBACK AutoAwayTimer(HWND, UINT, UINT_PTR, DWORD) else if ((it->optionFlags & FLAG_SETNA) && sts1setTime >= sts2Time) { /* when set STATUS2, currentMode doesn't have to be in the selected status list (statusFlags) */ /* from STATUS1_SET to STATUS2_SET */ - it->m_lastStatus = CallProtoService(it->m_szName, PS_GETSTATUS, 0, 0); + it->m_lastStatus = Proto_GetStatus(it->m_szName); it->aaaStatus = it->lv2Status; it->bStatusChanged = statusChanged = true; changeState(*it, STATUS2_SET); @@ -282,7 +282,7 @@ static VOID CALLBACK AutoAwayTimer(HWND, UINT, UINT_PTR, DWORD) /* from STATUS2_SET to HIDDEN_ACTIVE */ /* Remember: after status1 is set, and "only on inactive" is NOT set, it implies !reset. */ changeState(*it, HIDDEN_ACTIVE); - it->m_lastStatus = CallProtoService(it->m_szName, PS_GETSTATUS, 0, 0); + it->m_lastStatus = Proto_GetStatus(it->m_szName); } } @@ -298,7 +298,7 @@ static VOID CALLBACK AutoAwayTimer(HWND, UINT, UINT_PTR, DWORD) currentMode != it->lv2Status && (it->statusFlags & StatusModeToProtoFlag(currentMode)) && (mouseStationaryTimer >= sts2Time || (sts1setTime >= sts2Time && !(it->optionFlags & FLAG_LV2ONINACTIVE)))) { /* HIDDEN_ACTIVE to STATUS2_SET */ - it->m_lastStatus = it->originalStatusMode = CallProtoService(it->m_szName, PS_GETSTATUS, 0, 0); + it->m_lastStatus = it->originalStatusMode = Proto_GetStatus(it->m_szName); it->aaaStatus = it->lv2Status; it->bStatusChanged = statusChanged = true; changeState(*it, STATUS2_SET); @@ -306,7 +306,7 @@ static VOID CALLBACK AutoAwayTimer(HWND, UINT, UINT_PTR, DWORD) } if (it->curState == SET_ORGSTATUS) { /* SET_ORGSTATUS to ACTIVE */ - it->m_lastStatus = CallProtoService(it->m_szName, PS_GETSTATUS, 0, 0); + it->m_lastStatus = Proto_GetStatus(it->m_szName); it->aaaStatus = it->originalStatusMode; confirm = (it->optionFlags & FLAG_CONFIRM) ? TRUE : confirm; it->bStatusChanged = statusChanged = true; diff --git a/plugins/StatusManager/src/KeepStatus/keepstatus.cpp b/plugins/StatusManager/src/KeepStatus/keepstatus.cpp index e9b45a9461..1b13ad2dfc 100644 --- a/plugins/StatusManager/src/KeepStatus/keepstatus.cpp +++ b/plugins/StatusManager/src/KeepStatus/keepstatus.cpp @@ -168,7 +168,7 @@ int SMProto::GetStatus() const { switch (m_status) { case ID_STATUS_CURRENT: - return CallProtoService(m_szName, PS_GETSTATUS, 0, 0); + return Proto_GetStatus(m_szName); case ID_STATUS_LAST: return m_lastStatus; default: @@ -180,7 +180,7 @@ static int SetCurrentStatus() { TProtoSettings ps(protoList); for (auto &p : ps) { - int realStatus = CallProtoService(p->m_szName, PS_GETSTATUS, 0, 0); + int realStatus = Proto_GetStatus(p->m_szName); int curStatus = p->GetStatus(); if (curStatus == ID_STATUS_DISABLED) continue; @@ -523,7 +523,7 @@ static VOID CALLBACK CheckAckStatusTimer(HWND, UINT, UINT_PTR, DWORD) StopTimer(IDT_PROCESSACK); for (auto &it : protoList) { int curStatus = it->GetStatus(); - int newStatus = CallProtoService(it->m_szName, PS_GETSTATUS, 0, 0); + int newStatus = Proto_GetStatus(it->m_szName); // ok, np if (curStatus == ID_STATUS_CURRENT || curStatus == ID_STATUS_DISABLED || curStatus == newStatus || newStatus > MAX_STATUS) continue; @@ -558,7 +558,7 @@ static VOID CALLBACK CheckConnectionTimer(HWND, UINT, UINT_PTR, DWORD) bool setStatus = false; for (auto &it : protoList) { - int realStatus = CallProtoService(it->m_szName, PS_GETSTATUS, 0, 0); + int realStatus = Proto_GetStatus(it->m_szName); int shouldBeStatus = it->GetStatus(); if (shouldBeStatus == ID_STATUS_LAST) shouldBeStatus = it->m_lastStatus; @@ -601,7 +601,7 @@ static int StopChecking() BOOL isOk = TRUE; for (auto &it : protoList) { int curStatus = it->GetStatus(); - int newStatus = CallProtoService(it->m_szName, PS_GETSTATUS, 0, 0); + int newStatus = Proto_GetStatus(it->m_szName); if (newStatus != curStatus) { it->AssignStatus(newStatus); isOk = FALSE; @@ -626,7 +626,7 @@ static VOID CALLBACK AfterCheckTimer(HWND, UINT, UINT_PTR, DWORD) bool setStatus = false; for (auto &it : protoList) { - int realStatus = CallProtoService(it->m_szName, PS_GETSTATUS, 0, 0); + int realStatus = Proto_GetStatus(it->m_szName); int shouldBeStatus = it->GetStatus(); if (shouldBeStatus == ID_STATUS_LAST) // this should never happen shouldBeStatus = it->m_lastStatus; @@ -953,7 +953,7 @@ INT_PTR EnableProtocolService(WPARAM wParam, LPARAM lParam) for (auto &it : protoList) { if (!mir_strcmp(szProto, it->m_szName)) { if (wParam) - it->AssignStatus(CallProtoService(it->m_szName, PS_GETSTATUS, 0, 0)); + it->AssignStatus(Proto_GetStatus(it->m_szName)); else it->AssignStatus(ID_STATUS_DISABLED); diff --git a/plugins/StatusManager/src/StartupStatus/startupstatus.cpp b/plugins/StatusManager/src/StartupStatus/startupstatus.cpp index 1b0cdb1de5..6eb6bb820a 100644 --- a/plugins/StatusManager/src/StartupStatus/startupstatus.cpp +++ b/plugins/StatusManager/src/StartupStatus/startupstatus.cpp @@ -230,7 +230,7 @@ static int OnOkToExit(WPARAM, LPARAM) char lastName[128], lastMsg[128]; mir_snprintf(lastName, "%s%s", PREFIX_LAST, pa->szModuleName); - db_set_w(0, SSMODULENAME, lastName, (WORD)CallProtoService(pa->szModuleName, PS_GETSTATUS, 0, 0)); + db_set_w(0, SSMODULENAME, lastName, pa->iRealStatus); mir_snprintf(lastMsg, "%s%s", PREFIX_LASTMSG, pa->szModuleName); db_unset(0, SSMODULENAME, lastMsg); diff --git a/plugins/StatusManager/src/commonstatus.cpp b/plugins/StatusManager/src/commonstatus.cpp index d928e53bde..13e7108af6 100644 --- a/plugins/StatusManager/src/commonstatus.cpp +++ b/plugins/StatusManager/src/commonstatus.cpp @@ -117,12 +117,13 @@ int GetActualStatus(PROTOCOLSETTINGEX *protoSetting) { if (protoSetting->m_status == ID_STATUS_LAST) { if ((protoSetting->m_lastStatus < MIN_STATUS) || (protoSetting->m_lastStatus > MAX_STATUS)) - return CallProtoService(protoSetting->m_szName, PS_GETSTATUS, 0, 0); + return Proto_GetStatus(protoSetting->m_szName); + return protoSetting->m_lastStatus; } if (protoSetting->m_status == ID_STATUS_CURRENT) - return CallProtoService(protoSetting->m_szName, PS_GETSTATUS, 0, 0); + return Proto_GetStatus(protoSetting->m_szName); if ((protoSetting->m_status < ID_STATUS_OFFLINE) || (protoSetting->m_status > ID_STATUS_OUTTOLUNCH)) { log_debugA("invalid status detected: %d", protoSetting->m_status); @@ -243,7 +244,7 @@ INT_PTR SetStatusEx(WPARAM wParam, LPARAM) log_debugA("CommonStatus: incorrect status for %s (%d)", p->m_szName, p->m_status); continue; } - int oldstatus = CallProtoService(p->m_szName, PS_GETSTATUS, 0, 0); + int oldstatus = Proto_GetStatus(p->m_szName); // set last status p->m_lastStatus = oldstatus; if (IsStatusConnecting(oldstatus)) { diff --git a/plugins/StatusManager/src/confirmdialog.cpp b/plugins/StatusManager/src/confirmdialog.cpp index f0bed4fa15..a833408839 100644 --- a/plugins/StatusManager/src/confirmdialog.cpp +++ b/plugins/StatusManager/src/confirmdialog.cpp @@ -120,7 +120,7 @@ static int SetStatusList(HWND hwndDlg) int actualStatus; switch (it->m_status) { case ID_STATUS_LAST: actualStatus = it->m_lastStatus; break; - case ID_STATUS_CURRENT: actualStatus = CallProtoService(it->m_szName, PS_GETSTATUS, 0, 0); break; + case ID_STATUS_CURRENT: actualStatus = Proto_GetStatus(it->m_szName); break; default: actualStatus = it->m_status; } wchar_t *status = Clist_GetStatusModeDescription(actualStatus, 0); @@ -272,7 +272,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP // CURRENT STATUS else if (proto->m_status == ID_STATUS_CURRENT) { - int currentStatus = CallProtoService(proto->m_szName, PS_GETSTATUS, 0, 0); + int currentStatus = Proto_GetStatus(proto->m_szName); wchar_t current[80]; mir_snwprintf(current, L"%s (%s)", TranslateT("<current>"), Clist_GetStatusModeDescription(currentStatus, 0)); ListView_SetItemText(GetDlgItem(hwndDlg, IDC_STARTUPLIST), lvItem.iItem, 1, current); @@ -349,7 +349,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP } // current - int currentStatus = CallProtoService(proto->m_szName, PS_GETSTATUS, 0, 0); + int currentStatus = Proto_GetStatus(proto->m_szName); mir_snwprintf(buf, L"%s (%s)", TranslateT("<current>"), Clist_GetStatusModeDescription(currentStatus, 0)); item = SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_ADDSTRING, 0, (LPARAM)buf); SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_SETITEMDATA, item, ID_STATUS_CURRENT); diff --git a/plugins/StopSpamMod/src/stopspam.cpp b/plugins/StopSpamMod/src/stopspam.cpp index d4823b49af..8eaea7f827 100755 --- a/plugins/StopSpamMod/src/stopspam.cpp +++ b/plugins/StopSpamMod/src/stopspam.cpp @@ -54,7 +54,7 @@ int OnDbEventAdded(WPARAM hContact, LPARAM hDbEvent) mir_free(EventText); } if (gbInvisDisable) { - if (CallProtoService(dbei.szModule, PS_GETSTATUS, 0, 0) == ID_STATUS_INVISIBLE) + if (Proto_GetStatus(dbei.szModule) == ID_STATUS_INVISIBLE) msg = 0; else if (db_get_w(hContact, dbei.szModule, "ApparentMode", 0) == ID_STATUS_OFFLINE) msg = 0; //is it useful ? @@ -128,7 +128,7 @@ int OnDbEventFilterAdd(WPARAM w, LPARAM l) bool bSendMsg = true; if (gbInvisDisable) { - if (CallProtoService(dbei->szModule, PS_GETSTATUS, 0, 0) == ID_STATUS_INVISIBLE) + if (Proto_GetStatus(dbei->szModule) == ID_STATUS_INVISIBLE) bSendMsg = false; else if (db_get_w(hContact, dbei->szModule, "ApparentMode", 0) == ID_STATUS_OFFLINE) bSendMsg = false; //is it useful ? diff --git a/plugins/StopSpamMod/src/utilities.cpp b/plugins/StopSpamMod/src/utilities.cpp index e8621d6622..1328b68d78 100755 --- a/plugins/StopSpamMod/src/utilities.cpp +++ b/plugins/StopSpamMod/src/utilities.cpp @@ -248,7 +248,7 @@ void __cdecl CleanProtocolTmpThread(void *param) const char *szProto = (const char*)param;
while (true) {
- UINT status = CallProtoService(szProto, PS_GETSTATUS, 0, 0);
+ int status = Proto_GetStatus(szProto);
if (status > ID_STATUS_OFFLINE)
break;
Sleep(2000);
@@ -278,7 +278,7 @@ void __cdecl CleanProtocolExclThread(void *param) const char *szProto = (const char*)param;
while (true) {
- UINT status = CallProtoService(szProto, PS_GETSTATUS, 0, 0);
+ int status = Proto_GetStatus(szProto);
if (status > ID_STATUS_OFFLINE)
break;
Sleep(2000);
diff --git a/plugins/StopSpamPlus/src/services.cpp b/plugins/StopSpamPlus/src/services.cpp index 7428bf445c..3692a4a411 100644 --- a/plugins/StopSpamPlus/src/services.cpp +++ b/plugins/StopSpamPlus/src/services.cpp @@ -33,7 +33,7 @@ INT_PTR RemoveTempContacts(WPARAM, LPARAM lParam) // Check if protocol uses server side lists
DWORD caps = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0);
if (caps & PF1_SERVERCLIST) {
- int status = CallProtoService(szProto, PS_GETSTATUS, 0, 0);
+ int status = Proto_GetStatus(szProto);
if (status == ID_STATUS_OFFLINE || IsStatusConnecting(status))
// Set a flag so we remember to delete the contact when the protocol goes online the next time
db_set_b(hContact, "CList", "Delete", 1);
diff --git a/plugins/TabSRMM/src/chat_tools.cpp b/plugins/TabSRMM/src/chat_tools.cpp index 23c2bde316..79bc186c61 100644 --- a/plugins/TabSRMM/src/chat_tools.cpp +++ b/plugins/TabSRMM/src/chat_tools.cpp @@ -151,9 +151,8 @@ BOOL DoPopup(SESSION_INFO *si, GCEVENT *gce) char *szProto = dat ? dat->m_szProto : si->pszModule;
if (nen_options.dwStatusMask != -1) {
- DWORD dwStatus = 0;
if (szProto != nullptr) {
- dwStatus = (DWORD)CallProtoService(szProto, PS_GETSTATUS, 0, 0);
+ int dwStatus = Proto_GetStatus(szProto);
if (!(dwStatus == 0 || dwStatus <= ID_STATUS_OFFLINE || ((1 << (dwStatus - ID_STATUS_ONLINE)) & nen_options.dwStatusMask))) // should never happen, but...
return 0;
}
diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp index 92fc9fe9c6..89d57735f9 100644 --- a/plugins/TabSRMM/src/eventpopups.cpp +++ b/plugins/TabSRMM/src/eventpopups.cpp @@ -765,7 +765,7 @@ int tabSRMM_ShowPopup(MCONTACT hContact, MEVENT hDbEvent, WORD eventType, int wi if (nen_options.dwStatusMask != -1) {
if (szProto != nullptr) {
- DWORD dwStatus = (DWORD)CallProtoService(szProto, PS_GETSTATUS, 0, 0);
+ int dwStatus = Proto_GetStatus(szProto);
if (!(dwStatus == 0 || dwStatus <= ID_STATUS_OFFLINE || ((1 << (dwStatus - ID_STATUS_ONLINE)) & nen_options.dwStatusMask))) // should never happen, but...
return 0;
}
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index 38f59af9b9..5653d2dd2b 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -972,7 +972,7 @@ void CTabBaseDlg::DM_NotifyTyping(int mode) if (!(typeCaps & PF4_SUPPORTTYPING)) return; - DWORD protoStatus = CallProtoService(szProto, PS_GETSTATUS, 0, 0); + DWORD protoStatus = Proto_GetStatus(szProto); if (protoStatus < ID_STATUS_ONLINE) return; diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index a2e9c5d0c7..ba03372f6f 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -549,7 +549,7 @@ void CGlobals::logStatusChange(WPARAM wParam, const CContactCache *c) return;
// don't log them if WE are logging off
- if (CallProtoService(c->getProto(), PS_GETSTATUS, 0, 0) == ID_STATUS_OFFLINE)
+ if (Proto_GetStatus(c->getProto()) == ID_STATUS_OFFLINE)
return;
WORD wStatus = LOWORD(wParam);
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp index 7bcb6a345e..e7ca3940e3 100644 --- a/plugins/TabSRMM/src/mim.cpp +++ b/plugins/TabSRMM/src/mim.cpp @@ -462,7 +462,7 @@ int CMimAPI::MessageEventAdded(WPARAM hContact, LPARAM hDbEvent) szProto = GetContactProto(db_mc_getSrmmSub(hContact)); if (szProto) { - DWORD dwStatus = (DWORD)CallProtoService(szProto, PS_GETSTATUS, 0, 0); + int dwStatus = Proto_GetStatus(szProto); if (dwStatus == 0 || dwStatus <= ID_STATUS_OFFLINE || ((1 << (dwStatus - ID_STATUS_ONLINE)) & dwStatusMask)) // should never happen, but... bAllowAutoCreate = true; } diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index c138fc9909..94ff7530a0 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -1734,7 +1734,7 @@ void CTabBaseDlg::SendHBitmapAsFile(HBITMAP hbmp) const bool fSend = true;
const char *szProto = m_cache->getActiveProto();
- WORD wMyStatus = (WORD)CallProtoService(szProto, PS_GETSTATUS, 0, 0);
+ int wMyStatus = Proto_GetStatus(szProto);
DWORD protoCaps = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0);
DWORD typeCaps = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0);
diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp index 37f642ca4e..e98a46c087 100644 --- a/plugins/TabSRMM/src/sendlater.cpp +++ b/plugins/TabSRMM/src/sendlater.cpp @@ -376,7 +376,7 @@ int CSendLater::sendIt(CSendLaterJob *job) if (!hContact || szProto == nullptr)
return 0;
- WORD wMyStatus = (WORD)CallProtoService(szProto, PS_GETSTATUS, 0, 0);
+ int wMyStatus = Proto_GetStatus(szProto);
// status mode checks
if (wMyStatus == ID_STATUS_OFFLINE) {
diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp index f3fd175d27..59730218ce 100644 --- a/plugins/TipperYM/src/popwin.cpp +++ b/plugins/TipperYM/src/popwin.cpp @@ -80,7 +80,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa else a2t(pwd->clcit.szProto, pwd->swzTitle, TITLE_TEXT_LEN); // protocol status - WORD wStatus = (WORD)CallProtoService(pwd->clcit.szProto, PS_GETSTATUS, 0, 0); + int wStatus = Proto_GetStatus(pwd->clcit.szProto); // get status icon if (pwd->bIsIconVisible[0]) { diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp index 95c0051e77..cd69f7bf38 100644 --- a/plugins/TipperYM/src/subst.cpp +++ b/plugins/TipperYM/src/subst.cpp @@ -194,7 +194,7 @@ bool CanRetrieveStatusMsg(MCONTACT hContact, char *szProto) iFlags = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & (PF1_VISLIST | PF1_INVISLIST); if (opt.bDisableIfInvisible && iFlags) { int iVisMode = db_get_w(hContact, szProto, "ApparentMode", 0); - int wProtoStatus = CallProtoService(szProto, PS_GETSTATUS, 0, 0); + int wProtoStatus = Proto_GetStatus(szProto); if ((iVisMode == ID_STATUS_OFFLINE) || (wProtoStatus == ID_STATUS_INVISIBLE && iVisMode != ID_STATUS_ONLINE)) return false; return true; @@ -216,7 +216,7 @@ wchar_t* GetStatusMessageText(MCONTACT hContact) if (!mir_strcmp(szProto, META_PROTO)) hContact = db_mc_getMostOnline(hContact); else { - WORD wStatus = (int)CallProtoService(szProto, PS_GETSTATUS, 0, 0); + WORD wStatus = Proto_GetStatus(szProto); if (wStatus == ID_STATUS_OFFLINE) return nullptr; diff --git a/plugins/TrafficCounter/src/TrafficCounter.cpp b/plugins/TrafficCounter/src/TrafficCounter.cpp index f164c09816..7a43bc55fc 100644 --- a/plugins/TrafficCounter/src/TrafficCounter.cpp +++ b/plugins/TrafficCounter/src/TrafficCounter.cpp @@ -471,7 +471,7 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC) // Изображаем иконку аккаунта.
if (unOptions.DrawProtoIcon) {
TC_DrawIconEx(hdc, rect.left, rect.top,
- Skin_LoadProtoIcon(ProtoList[i].name, CallProtoService(ProtoList[i].name, PS_GETSTATUS, 0, 0)), b, ClistModernPresent);
+ Skin_LoadProtoIcon(ProtoList[i].name, Proto_GetStatus(ProtoList[i].name)), b, ClistModernPresent);
dx = 19;
}
// Изображаем имя аккаунта
@@ -638,7 +638,7 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC) ahIcon = (HICON*)mir_realloc(ahIcon, sizeof(HICON) * (RowsNumber + 1));
ExtraText[RowsNumber] = mir_a2u(ProtoList[i].name);
- ahIcon[RowsNumber++] = Skin_LoadProtoIcon(ProtoList[i].name, CallProtoService(ProtoList[i].name, PS_GETSTATUS, 0, 0));
+ ahIcon[RowsNumber++] = Skin_LoadProtoIcon(ProtoList[i].name, Proto_GetStatus(ProtoList[i].name));
}
}
// Ещё 2 особых элемента.
diff --git a/plugins/UserInfoEx/src/stdafx.h b/plugins/UserInfoEx/src/stdafx.h index 3cf7dc70dc..b9b3a02457 100644 --- a/plugins/UserInfoEx/src/stdafx.h +++ b/plugins/UserInfoEx/src/stdafx.h @@ -208,7 +208,7 @@ DWORD hashSetting(LPCSTR szStr); //old miranda hash static FORCEINLINE BOOL IsProtoOnline(LPSTR pszProto)
{
- return pszProto && pszProto[0] && CallProtoService(pszProto, PS_GETSTATUS, NULL, NULL) >= ID_STATUS_ONLINE;
+ return pszProto && pszProto[0] && Proto_GetStatus(pszProto) >= ID_STATUS_ONLINE;
}
static FORCEINLINE BOOL IsProtoAccountEnabled(PROTOACCOUNT *pAcc)
diff --git a/plugins/Variables/src/parse_miranda.cpp b/plugins/Variables/src/parse_miranda.cpp index 70c69418b5..e81a75d802 100644 --- a/plugins/Variables/src/parse_miranda.cpp +++ b/plugins/Variables/src/parse_miranda.cpp @@ -332,7 +332,7 @@ static wchar_t* parseMyStatus(ARGUMENTSINFO *ai) if (ai->argc == 1 || mir_wstrlen(ai->targv[1]) == 0)
status = CallService(MS_CLIST_GETSTATUSMODE, 0, 0);
else
- status = CallProtoService(_T2A(ai->targv[1]), PS_GETSTATUS, 0, 0);
+ status = Proto_GetStatus(_T2A(ai->targv[1]));
wchar_t *szStatus = Clist_GetStatusModeDescription(status, 0);
return (szStatus != nullptr) ? mir_wstrdup(szStatus) : nullptr;
diff --git a/plugins/WinterSpeak/src/SpeakConfig.cpp b/plugins/WinterSpeak/src/SpeakConfig.cpp index f80716a728..1d0d4185d7 100644 --- a/plugins/WinterSpeak/src/SpeakConfig.cpp +++ b/plugins/WinterSpeak/src/SpeakConfig.cpp @@ -52,7 +52,7 @@ bool SpeakConfig::say(const std::wstring &sentence, MCONTACT user, bool message) // get the status of the protocol of this user
const char *protocol = GetContactProto(user);
- switch (CallProtoService(protocol, PS_GETSTATUS, 0, 0)) {
+ switch (Proto_GetStatus(protocol)) {
case ID_STATUS_ONLINE:
active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Online);
break;
diff --git a/plugins/ZeroNotification/src/main.cpp b/plugins/ZeroNotification/src/main.cpp index 66ca7a1903..b92f20bc6a 100644 --- a/plugins/ZeroNotification/src/main.cpp +++ b/plugins/ZeroNotification/src/main.cpp @@ -118,7 +118,7 @@ static int ProtoAck(WPARAM, LPARAM lParam) if (ack->type == ACKTYPE_STATUS && ack->result == ACKRESULT_SUCCESS) {
long status = 0;
for (auto &pa : Accounts())
- status = status | Proto_Status2Flag(CallProtoService(pa->szModuleName, PS_GETSTATUS, 0, 0));
+ status = status | Proto_Status2Flag(Proto_GetStatus(pa->szModuleName));
SetNotify(status);
}
|