diff options
Diffstat (limited to 'plugins/SMS/src/functions.cpp')
-rw-r--r-- | plugins/SMS/src/functions.cpp | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/plugins/SMS/src/functions.cpp b/plugins/SMS/src/functions.cpp index c7ec530e67..5597ec2a9b 100644 --- a/plugins/SMS/src/functions.cpp +++ b/plugins/SMS/src/functions.cpp @@ -535,7 +535,7 @@ LRESULT CALLBACK MessageSubclassProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM //It called when SMS plugin loaded and upon change in the account list.
int RefreshAccountList(WPARAM eventCode,LPARAM lParam)
{
- SIZE_T dwAccCount=0,i,dwSMSAccountsCount=0;
+ int dwAccCount=0,dwSMSAccountsCount=0;
PROTOACCOUNT **ppaAccounts;
ProtoEnumAccounts((int*)&dwAccCount,&ppaAccounts);
@@ -543,22 +543,12 @@ int RefreshAccountList(WPARAM eventCode,LPARAM lParam) FreeAccountList();
ssSMSSettings.ppaSMSAccounts=(PROTOACCOUNT**)MEMALLOC((dwAccCount*sizeof(LPVOID)));
if (ssSMSSettings.ppaSMSAccounts)
- {
- char szServiceName[MAX_PATH];
+ for (int i=0; i < dwAccCount; i++)
+ if ( IsAccountEnabled(ppaAccounts[i]))
+ if ( ProtoServiceExists(ppaAccounts[i]->szModuleName,MS_ICQ_SENDSMS))
+ ssSMSSettings.ppaSMSAccounts[dwSMSAccountsCount++] = ppaAccounts[i];
- for (i=0;i<dwAccCount;i++)
- {
- if (IsAccountEnabled(ppaAccounts[i]))
- {
- mir_snprintf(szServiceName,sizeof(szServiceName),"%s%s",ppaAccounts[i]->szModuleName,MS_ICQ_SENDSMS);
- if (ServiceExists(szServiceName))
- {
- ssSMSSettings.ppaSMSAccounts[dwSMSAccountsCount++]=ppaAccounts[i];
- }
- }
- }
- }
- ssSMSSettings.dwSMSAccountsCount=dwSMSAccountsCount;
+ ssSMSSettings.dwSMSAccountsCount = dwSMSAccountsCount;
SendSMSWindowsUpdateAllAccountLists();
return 0;
|