From f7fdb4ef4e5021b2f96d96af9aa0d467ece9660f Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Sun, 13 Jun 2010 21:09:27 +0300 Subject: gettings jabber api's code ) --- utilities.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'utilities.cpp') diff --git a/utilities.cpp b/utilities.cpp index 170dcca..b2c28f0 100644 --- a/utilities.cpp +++ b/utilities.cpp @@ -30,6 +30,30 @@ TCHAR* __stdcall UniGetContactSettingUtf(HANDLE hContact, const char *szModule,c return szRes; } +extern IJabberInterface *JabberInterface[10]; +extern int JabberAccountsCount; + +int GetJabberInterface(WPARAM, LPARAM) //get interface for all jabber accounts, options later +{ + IJabberInterface *JIftmp[50]; //should it be dynamic ? + int count = 0; + PROTOACCOUNT **accounts; + ProtoEnumAccounts(&count, &accounts); + JabberAccountsCount = 0; + for(int i = 0; i < count; i++) + { + char *tmp = mir_u2a(accounts[i]->tszAccountName); + JIftmp[i] = getJabberApi(tmp); + if(JIftmp[i]) + { + JabberInterface[JabberAccountsCount] = JIftmp[i]; + JabberAccountsCount++; + } + mir_free(tmp); + } + return 0; +} + char *date() { -- cgit v1.2.3