summaryrefslogtreecommitdiff
path: root/metacontacts/meta_services.c
diff options
context:
space:
mode:
Diffstat (limited to 'metacontacts/meta_services.c')
-rw-r--r--metacontacts/meta_services.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/metacontacts/meta_services.c b/metacontacts/meta_services.c
index 0b7a15f..d051937 100644
--- a/metacontacts/meta_services.c
+++ b/metacontacts/meta_services.c
@@ -67,6 +67,7 @@ char proto_names[MAX_PROTOCOLS * 128];
HANDLE hProtoIcons[MAX_PROTOCOLS * 2]; // online and offline icons
UINT_PTR setStatusTimerId = 0;
+BOOL firstSetOnline = TRUE; // see Meta_SetStatus function
/** Get the capabilities of the "MetaContacts" protocol.
*
@@ -167,7 +168,7 @@ void CALLBACK SetStatusThread(HWND hWnd, UINT msg, UINT_PTR id, DWORD dw)
//Sleep(options.set_status_from_offline_delay);
- mcStatus = (int)ID_STATUS_OFFLINE;
+ mcStatus = (int)ID_STATUS_ONLINE;
ProtoBroadcastAck(META_PROTO,NULL,ACKTYPE_STATUS,ACKRESULT_SUCCESS, (HANDLE)previousMode, mcStatus);
//return 0;
@@ -180,10 +181,12 @@ void CALLBACK SetStatusThread(HWND hWnd, UINT msg, UINT_PTR id, DWORD dw)
*/
int Meta_SetStatus(WPARAM wParam,LPARAM lParam)
{
- if(mcStatus == ID_STATUS_OFFLINE) {
+ // firstSetOnline starts out true - used to delay metacontact's 'onlineness' to prevent double status notifications on startup
+ if(mcStatus == ID_STATUS_OFFLINE && firstSetOnline) {
// causes crash on exit if miranda is closed in under options.set_status_from_offline milliseconds!
//CloseHandle( CreateThread( NULL, 0, SetStatusThread, (void *)wParam, 0, 0 ));
setStatusTimerId = SetTimer(0, 0, options.set_status_from_offline_delay, SetStatusThread);
+ firstSetOnline = FALSE;
} else {
previousMode = mcStatus;
mcStatus = (int)wParam;