diff options
author | George Hazan <ghazan@miranda.im> | 2018-04-07 20:14:21 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-04-07 20:14:21 +0300 |
commit | f60c78abfbd5f279b30de729046b805bba8e00b0 (patch) | |
tree | 1120bba828b2151604e98163aa7a3fe221264068 /src | |
parent | 26a653ecae7edbeefb7966e08714e152c73b78eb (diff) |
Proto_GetStatus is used everywhere instead of PS_GETSTATUS
Diffstat (limited to 'src')
-rw-r--r-- | src/core/stdmsg/src/msgdialog.cpp | 2 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgs.cpp | 4 | ||||
-rw-r--r-- | src/core/stduserinfo/src/userinfo.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/chat_clist.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/clisttray.cpp | 12 | ||||
-rw-r--r-- | src/mir_app/src/clui.cpp | 4 | ||||
-rw-r--r-- | src/mir_app/src/cluiservices.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/menu_clist.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/meta_utils.cpp | 4 |
9 files changed, 17 insertions, 17 deletions
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index ed1e9e0f2f..c7547331b9 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -463,7 +463,7 @@ void CSrmmWindow::NotifyTyping(int mode) if (!m_szProto)
return;
- DWORD protoStatus = CallProtoService(m_szProto, PS_GETSTATUS, 0, 0);
+ int protoStatus = Proto_GetStatus(m_szProto);
DWORD protoCaps = CallProtoService(m_szProto, PS_GETCAPS, PFLAGNUM_1, 0);
DWORD typeCaps = CallProtoService(m_szProto, PS_GETCAPS, PFLAGNUM_4, 0);
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index 7c422a5d7b..c3041c0e19 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -86,7 +86,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) Skin_PlaySound("AlertMsg");
char *szProto = GetContactProto(hContact);
- if (szProto && (g_dat.popupFlags & SRMMStatusToPf2(CallProtoService(szProto, PS_GETSTATUS, 0, 0)))) {
+ if (szProto && (g_dat.popupFlags & SRMMStatusToPf2(Proto_GetStatus(szProto)))) {
GetContainer()->AddPage(hContact);
return 0;
}
@@ -255,7 +255,7 @@ static void RestoreUnreadMessageAlerts(void) continue;
char *szProto = GetContactProto(hContact);
- if (szProto && (g_dat.popupFlags & SRMMStatusToPf2(CallProtoService(szProto, PS_GETSTATUS, 0, 0))))
+ if (szProto && (g_dat.popupFlags & SRMMStatusToPf2(Proto_GetStatus(szProto))))
autoPopup = true;
if (autoPopup && !windowAlreadyExists)
diff --git a/src/core/stduserinfo/src/userinfo.cpp b/src/core/stduserinfo/src/userinfo.cpp index aab4733403..83f50d9ef1 100644 --- a/src/core/stduserinfo/src/userinfo.cpp +++ b/src/core/stduserinfo/src/userinfo.cpp @@ -405,7 +405,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (szProto == nullptr)
EnableWindow(GetDlgItem(hwndDlg, IDC_UPDATE), FALSE);
else {
- if (CallProtoService(szProto, PS_GETSTATUS, 0, 0) < ID_STATUS_ONLINE)
+ if (Proto_GetStatus(szProto) < ID_STATUS_ONLINE)
EnableWindow(GetDlgItem(hwndDlg, IDC_UPDATE), FALSE);
else
EnableWindow(GetDlgItem(hwndDlg, IDC_UPDATE), !IsWindowVisible(GetDlgItem(hwndDlg, IDC_UPDATING)));
diff --git a/src/mir_app/src/chat_clist.cpp b/src/mir_app/src/chat_clist.cpp index 19f51fdd3d..82a7aa4843 100644 --- a/src/mir_app/src/chat_clist.cpp +++ b/src/mir_app/src/chat_clist.cpp @@ -165,7 +165,7 @@ int PrebuildContactMenu(WPARAM hContact, LPARAM) // display this menu item only for chats
if (db_get_b(hContact, szProto, "ChatRoom", 0)) {
// still hide it for offline protos
- if (CallProtoService(szProto, PS_GETSTATUS, 0, 0) != ID_STATUS_OFFLINE) {
+ if (Proto_GetStatus(szProto) != ID_STATUS_OFFLINE) {
if (db_get_w(hContact, szProto, "Status", 0) == ID_STATUS_OFFLINE) {
if (ProtoServiceExists(szProto, PS_JOINCHAT)) {
bEnabledJoin = true;
diff --git a/src/mir_app/src/clisttray.cpp b/src/mir_app/src/clisttray.cpp index 202661df18..658a11fd70 100644 --- a/src/mir_app/src/clisttray.cpp +++ b/src/mir_app/src/clisttray.cpp @@ -47,7 +47,7 @@ static bool fTrayInited; static wchar_t* sttGetXStatus(const char *szProto)
{
- if (CallProtoServiceInt(0, szProto, PS_GETSTATUS, 0, 0) > ID_STATUS_OFFLINE) {
+ if (Proto_GetStatus(szProto) > ID_STATUS_OFFLINE) {
wchar_t tszStatus[512];
CUSTOM_STATUS cs = { sizeof(cs) };
cs.flags = CSSF_MASK_MESSAGE | CSSF_UNICODE;
@@ -241,7 +241,7 @@ int fnTrayIconInit(HWND hwnd) else
szProto = nullptr;
- Clist_TrayIconAdd(hwnd, nullptr, szProto, szProto ? CallProtoServiceInt(0, szProto, PS_GETSTATUS, 0, 0) : CallService(MS_CLIST_GETSTATUSMODE, 0, 0));
+ Clist_TrayIconAdd(hwnd, nullptr, szProto, szProto ? Proto_GetStatus(szProto) : CallService(MS_CLIST_GETSTATUSMODE, 0, 0));
db_free(&dbv);
}
else if (trayIconSetting == SETTING_TRAYICON_MULTI && (averageMode < 0 || db_get_b(0, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT))) {
@@ -495,7 +495,7 @@ int fnTrayCalcChanged(const char *szChangedProto, int averageMode, int netProtoC return Clist_TrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(0, nullptr, averageMode), nullptr);
if (db_get_b(0, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT))
- return Clist_TrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(0, szChangedProto, CallProtoServiceInt(0, szChangedProto, PS_GETSTATUS, 0, 0)), (char*)szChangedProto);
+ return Clist_TrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(0, szChangedProto, Proto_GetStatus(szChangedProto)), (char*)szChangedProto);
if (cli.trayIcon == nullptr || cli.trayIcon[0].szProto == nullptr)
return Clist_TrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(0, nullptr, averageMode), nullptr);
@@ -507,13 +507,13 @@ int fnTrayCalcChanged(const char *szChangedProto, int averageMode, int netProtoC switch (trayIconSetting) {
case SETTING_TRAYICON_CYCLE:
Clist_TraySetTimer();
- return Clist_TrayIconSetBaseInfo(ImageList_GetIcon(hCListImages, cli.pfnIconFromStatusMode(szChangedProto, CallProtoServiceInt(0, szChangedProto, PS_GETSTATUS, 0, 0), 0), ILD_NORMAL), nullptr);
+ return Clist_TrayIconSetBaseInfo(ImageList_GetIcon(hCListImages, cli.pfnIconFromStatusMode(szChangedProto, Proto_GetStatus(szChangedProto), 0), ILD_NORMAL), nullptr);
case SETTING_TRAYICON_MULTI:
if (!cli.trayIcon)
Clist_TrayIconRemove(nullptr, nullptr);
else if ((cli.trayIconCount > 1 || netProtoCount == 1) || db_get_b(0, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT))
- return Clist_TrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(0, szChangedProto, CallProtoServiceInt(0, szChangedProto, PS_GETSTATUS, 0, 0)), (char*)szChangedProto);
+ return Clist_TrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(0, szChangedProto, Proto_GetStatus(szChangedProto)), (char*)szChangedProto);
else {
Clist_TrayIconDestroy(cli.hwndContactList);
cli.pfnTrayIconInit(cli.hwndContactList);
@@ -522,7 +522,7 @@ int fnTrayCalcChanged(const char *szChangedProto, int averageMode, int netProtoC case SETTING_TRAYICON_SINGLE:
ptrA szProto(db_get_sa(0, "CList", "PrimaryStatus"));
- return Clist_TrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(0, szProto, szProto ? CallProtoServiceInt(0, szProto, PS_GETSTATUS, 0, 0) : CallService(MS_CLIST_GETSTATUSMODE, 0, 0)), szProto);
+ return Clist_TrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(0, szProto, szProto ? Proto_GetStatus(szProto) : CallService(MS_CLIST_GETSTATUSMODE, 0, 0)), szProto);
}
}
diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp index 2295c2b198..75c66b3b25 100644 --- a/src/mir_app/src/clui.cpp +++ b/src/mir_app/src/clui.cpp @@ -183,7 +183,7 @@ static INT_PTR MenuItem_DeleteContact(WPARAM wParam, LPARAM lParam) // Check if protocol uses server side lists
DWORD caps = CallProtoServiceInt(0, szProto, PS_GETCAPS, PFLAGNUM_1, 0);
if (caps & PF1_SERVERCLIST) {
- int status = CallProtoServiceInt(0, 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(wParam, "CList", "Delete", 1);
@@ -955,7 +955,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM int status, x;
SIZE textSize;
BYTE showOpts = db_get_b(0, "CLUI", "SBarShow", 1);
- status = CallProtoServiceInt(0, szProto, PS_GETSTATUS, 0, 0);
+ status = Proto_GetStatus(szProto);
SetBkMode(dis->hDC, TRANSPARENT);
x = dis->rcItem.left;
if (showOpts & 1) {
diff --git a/src/mir_app/src/cluiservices.cpp b/src/mir_app/src/cluiservices.cpp index a38b9db7c4..90880c2877 100644 --- a/src/mir_app/src/cluiservices.cpp +++ b/src/mir_app/src/cluiservices.cpp @@ -125,7 +125,7 @@ void fnCluiProtocolStatusChanged(int, const char*) x += GetSystemMetrics(SM_CXBORDER) * 4; // The SB panel doesnt allocate enough room
}
if (showOpts & 4) {
- wchar_t* modeDescr = Clist_GetStatusModeDescription(CallProtoServiceInt(0, g_menuProtos[i].szProto, PS_GETSTATUS, 0, 0), 0);
+ wchar_t* modeDescr = Clist_GetStatusModeDescription(Proto_GetStatus(g_menuProtos[i].szProto), 0);
GetTextExtentPoint32(hdc, modeDescr, (int)mir_wstrlen(modeDescr), &textSize);
x += textSize.cx;
x += GetSystemMetrics(SM_CXBORDER) * 4; // The SB panel doesnt allocate enough room
diff --git a/src/mir_app/src/menu_clist.cpp b/src/mir_app/src/menu_clist.cpp index af5047e9ba..f104dd942c 100644 --- a/src/mir_app/src/menu_clist.cpp +++ b/src/mir_app/src/menu_clist.cpp @@ -472,7 +472,7 @@ static INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM) }
}
else if (smep && smep->status && !smep->custom) {
- int curProtoStatus = (smep->szProto) ? CallProtoServiceInt(0, smep->szProto, PS_GETSTATUS, 0, 0) : Proto_GetAverageStatus();
+ int curProtoStatus = (smep->szProto) ? Proto_GetStatus(smep->szProto) : Proto_GetAverageStatus();
if (smep->status == curProtoStatus)
pimi->mi.flags |= CMIF_CHECKED;
else
diff --git a/src/mir_app/src/meta_utils.cpp b/src/mir_app/src/meta_utils.cpp index 86e841468e..0a5058ba81 100644 --- a/src/mir_app/src/meta_utils.cpp +++ b/src/mir_app/src/meta_utils.cpp @@ -234,7 +234,7 @@ MCONTACT Meta_GetMostOnlineSupporting(DBCachedContact *cc, int pflagnum, unsigne int most_online_status = ID_STATUS_OFFLINE;
MCONTACT most_online_contact = Meta_GetContactHandle(cc, cc->nDefault);
char *szProto = GetContactProto(most_online_contact);
- if (szProto && CallProtoService(szProto, PS_GETSTATUS, 0, 0) >= ID_STATUS_ONLINE) {
+ if (szProto && Proto_GetStatus(szProto) >= ID_STATUS_ONLINE) {
DWORD caps = CallProtoService(szProto, PS_GETCAPS, pflagnum, 0);
if (capability == -1 || (caps & capability) == capability) {
most_online_status = db_get_w(most_online_contact, szProto, "Status", ID_STATUS_OFFLINE);
@@ -256,7 +256,7 @@ MCONTACT Meta_GetMostOnlineSupporting(DBCachedContact *cc, int pflagnum, unsigne MCONTACT hContact = Meta_GetContactHandle(cc, i);
szProto = GetContactProto(hContact);
- if (szProto == nullptr || CallProtoService(szProto, PS_GETSTATUS, 0, 0) < ID_STATUS_ONLINE) // szProto offline or connecting
+ if (szProto == nullptr || Proto_GetStatus(szProto) < ID_STATUS_ONLINE) // szProto offline or connecting
continue;
DWORD caps = CallProtoService(szProto, PS_GETCAPS, pflagnum, 0);
|