diff options
-rw-r--r-- | MySpace/proto.cpp | 3 | ||||
-rw-r--r-- | MySpace/srmm_icon.cpp | 18 | ||||
-rw-r--r-- | MySpace/version.h | 2 |
3 files changed, 18 insertions, 5 deletions
diff --git a/MySpace/proto.cpp b/MySpace/proto.cpp index 8dcd810..8a04e6a 100644 --- a/MySpace/proto.cpp +++ b/MySpace/proto.cpp @@ -265,6 +265,7 @@ int AddToList(WPARAM wParam, LPARAM lParam) { msg_add.add_string("reason", "");
SendMessage(msg_add);
+
}
}
@@ -274,6 +275,8 @@ int AddToList(WPARAM wParam, LPARAM lParam) { } else {
DBDeleteContactSetting(hContact, "CList", "NotOnList");
DBDeleteContactSetting(hContact, "CList", "Hidden");
+
+ LookupUID(mpsr->uid);
}
return (int)hContact;
diff --git a/MySpace/srmm_icon.cpp b/MySpace/srmm_icon.cpp index 053b0c7..4aaa78f 100644 --- a/MySpace/srmm_icon.cpp +++ b/MySpace/srmm_icon.cpp @@ -11,10 +11,10 @@ int WindowEvent(WPARAM wParam, LPARAM lParam) { if(wd->uType != MSG_WINDOW_EVT_OPEN) return 0;
HANDLE hContact = wd->hContact, hSub = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
- if(!hSub) return 0;
+ //if(!hSub) return 0;
bool hide = false;
- if(!CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hSub, (LPARAM)MODULE))
+ if((hSub == 0 && !CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, (LPARAM)MODULE)) || (hSub != 0 && !CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hSub, (LPARAM)MODULE)))
hide = true;
StatusIconData sid = {0};
@@ -51,8 +51,13 @@ int IconPressed(WPARAM wParam, LPARAM lParam) { return 0;
}
+int ContactAdded(WPARAM wParam, LPARAM lParam) {
+
+ return 0;
+}
+
HICON hZapIcon = 0;
-HANDLE hEventIconPressed = 0, hEventWindow = 0;
+HANDLE hEventIconPressed = 0, hEventWindow = 0, hEventContactAdded;
void InitSRMMIcon() {
// add icon to srmm status icons
if(ServiceExists(MS_MSG_ADDICON)) {
@@ -66,11 +71,12 @@ void InitSRMMIcon() { sid.szTooltip = Translate("Send ZAP");
CallService(MS_MSG_ADDICON, 0, (LPARAM)&sid);
- // hook the window events so that we can can change the status of the icon for metacontacts
+ // hook the window events so that we can can change the status of the icon for myspace contacts and metacontacts if necessary
if(ServiceExists(MS_MC_GETMOSTONLINECONTACT)) // metas installed
hEventWindow = HookEvent(ME_MSG_WINDOWEVENT, WindowEvent);
hEventIconPressed = HookEvent(ME_MSG_ICONPRESSED, IconPressed);
+ /*
// show for all MySpace contacts
HANDLE hContact = ( HANDLE ) CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 );
while ( hContact != NULL ) {
@@ -81,10 +87,14 @@ void InitSRMMIcon() { }
hContact = ( HANDLE ) CallService( MS_DB_CONTACT_FINDNEXT, ( WPARAM ) hContact, 0 );
}
+ */
}
+
+ hEventContactAdded = HookEvent(ME_DB_CONTACT_ADDED, ContactAdded);
}
void DeinitSRMMIcon() {
+ if(hEventContactAdded) UnhookEvent(hEventContactAdded);
if(hZapIcon) DestroyIcon(hZapIcon);
if(hEventIconPressed) UnhookEvent(hEventIconPressed);
if(hEventWindow) UnhookEvent(hEventWindow);
diff --git a/MySpace/version.h b/MySpace/version.h index b5cedcf..d4ce78f 100644 --- a/MySpace/version.h +++ b/MySpace/version.h @@ -5,7 +5,7 @@ #define __MAJOR_VERSION 0
#define __MINOR_VERSION 0
#define __RELEASE_NUM 5
-#define __BUILD_NUM 9
+#define __BUILD_NUM 10
#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
#define __FILEVERSION_STRING_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM
|