diff options
Diffstat (limited to 'src/mir_app')
-rw-r--r-- | src/mir_app/src/mir_app.def | 1 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 1 | ||||
-rw-r--r-- | src/mir_app/src/protocols.cpp | 17 |
3 files changed, 13 insertions, 6 deletions
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index a6aab7290b..987cb33996 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -578,3 +578,4 @@ Clist_RemoveItemFromGroup @597 Clist_ClcOptionsChanged @598
Clist_GetRealStatus @599
Clist_GetGeneralizedStatus @600
+Proto_GetStatus @601
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 3c749c9007..6d6a10621a 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -578,3 +578,4 @@ Clist_RemoveItemFromGroup @597 Clist_ClcOptionsChanged @598
Clist_GetRealStatus @599
Clist_GetGeneralizedStatus @600
+Proto_GetStatus @601
diff --git a/src/mir_app/src/protocols.cpp b/src/mir_app/src/protocols.cpp index 0179f80bde..477dbd2083 100644 --- a/src/mir_app/src/protocols.cpp +++ b/src/mir_app/src/protocols.cpp @@ -310,15 +310,20 @@ MIR_APP_DLL(PROTOACCOUNT*) Proto_GetAccount(const char *accName) if (accName == nullptr)
return nullptr;
- int idx;
- PROTOACCOUNT temp;
- temp.szModuleName = (char*)accName;
- if ((idx = accounts.getIndex(&temp)) == -1)
- return nullptr;
+ return accounts.find((PROTOACCOUNT*)&accName);
+}
- return accounts[idx];
+MIR_APP_DLL(int) Proto_GetStatus(const char *accName)
+{
+ if (accName == nullptr)
+ return ID_STATUS_OFFLINE;
+
+ PROTOACCOUNT *pa = accounts.find((PROTOACCOUNT*)&accName);
+ return (pa) ? pa->iRealStatus : ID_STATUS_OFFLINE;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
MIR_APP_DLL(void) Proto_EnumAccounts(int *nAccs, PROTOACCOUNT ***pAccs)
{
if (nAccs) *nAccs = accounts.getCount();
|