diff options
Diffstat (limited to 'MySpace/proto.cpp')
-rw-r--r-- | MySpace/proto.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/MySpace/proto.cpp b/MySpace/proto.cpp index 0cdf64d..989424a 100644 --- a/MySpace/proto.cpp +++ b/MySpace/proto.cpp @@ -338,6 +338,7 @@ bool FileExists(char *filename) { CloseHandle(hFile);
return true;
}
+ return false;
}
int GetAvatarInfo(WPARAM wParam,LPARAM lParam) {
@@ -424,10 +425,19 @@ void RegisterProto() { CallService(MS_PROTO_REGISTERMODULE,0,(LPARAM)&pd);
}
+int IdleChanged(WPARAM wParam, LPARAM lParam) {
+ if(lParam & IDF_PRIVACY) return 0;
+
+ if((lParam & IDF_ISIDLE) && status == ID_STATUS_ONLINE) { // mimic official client - doesn't go idle when away (or invisible?)
+ SetServerStatus(ID_STATUS_IDLE);
+ }
+ return 0;
+}
+
#define NUM_FILTER_SERVICES 17
HANDLE hServices[NUM_FILTER_SERVICES];
-HANDLE hEventContactDeleted;
+HANDLE hEventContactDeleted, hEventIdle;
void CreateProtoServices() {
// create our services
int i = 0;
@@ -456,9 +466,11 @@ void CreateProtoServices() { // remember to modify the NUM_FILTER_SERVICES #define above if you add more services!
hEventContactDeleted = HookEvent(ME_DB_CONTACT_DELETED, ContactDeleted);
+ hEventIdle = HookEvent(ME_IDLE_CHANGED, IdleChanged);
}
void DeinitProto() {
+ UnhookEvent(hEventIdle);
UnhookEvent(hEventContactDeleted);
for(int i = 0; i < NUM_FILTER_SERVICES; i++)
DestroyServiceFunction(hServices[i]);
|