diff options
author | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2007-10-09 11:56:55 +0000 |
---|---|---|
committer | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2007-10-09 11:56:55 +0000 |
commit | 34deff968f1dcde932559ad45dd9c96d9920540c (patch) | |
tree | 2e3251bb62c4fa4fb02f89238918ce5edb5c7efd | |
parent | 97e27892c15f6f933b39fbeb1cc212ca7b87ff6a (diff) |
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@358 4f64403b-2f21-0410-a795-97e2b3489a10
-rw-r--r-- | MySpace/proto.cpp | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/MySpace/proto.cpp b/MySpace/proto.cpp index 7633141..fbd9e69 100644 --- a/MySpace/proto.cpp +++ b/MySpace/proto.cpp @@ -7,6 +7,11 @@ #include <malloc.h>
#include <ctime>
+// in case it's not in m_protosvc.h
+#ifndef PF4_IMSENDOFFLINE
+#define PF4_IMSENDOFFLINE 0x00000100 // protocol is able to send offline messages (v.0.8.0+ 2007/10/3)
+#endif
+
#define FAILED_MESSAGE_HANDLE 99998
int msg_id = 1;
@@ -385,6 +390,41 @@ int GetAvatarInfo(WPARAM wParam,LPARAM lParam) { }
+int GetMyAvatar(WPARAM wParam,LPARAM lParam) {
+ char *buff = (char *)wParam;
+ DBVARIANT dbv;
+ if(!DBGetContactSettingString(0, MODULE, "ImageURL", &dbv)) {
+ mir_snprintf(buff, (int)lParam, "%s", dbv.pszVal);
+ DBFreeVariant(&dbv);
+ return 0;
+ }
+ return 1;
+}
+
+int GetAvatarCaps(WPARAM wParam,LPARAM lParam) {
+ switch(wParam) {
+ case AF_MAXSIZE:
+ {
+ POINT *p = (POINT *)lParam;
+ p->x = p->y = -1;
+ }
+ return 0;
+ case AF_PROPORTION:
+ return PIP_NONE;
+ case AF_FORMATSUPPORTED:
+ return 1;
+ case AF_ENABLED:
+ return 1;
+ case AF_DONTNEEDDELAYS:
+ return 1;
+ case AF_MAXFILESIZE:
+ return 0;
+ case AF_DELAYAFTERFAIL:
+ return 0;
+ }
+ return 0;
+}
+
int ContactDeleted(WPARAM wParam, LPARAM lParam) {
HANDLE hContact = (HANDLE)wParam;
int uid = DBGetContactSettingDword(hContact, MODULE, "UID", 0);
@@ -463,7 +503,7 @@ int SettingChanged(WPARAM wParam, LPARAM lParam) { return 0;
}
-#define NUM_FILTER_SERVICES 17
+#define NUM_FILTER_SERVICES 19
HANDLE hServices[NUM_FILTER_SERVICES];
HANDLE hEventContactDeleted, hEventIdle, hEventSettingChanged;
@@ -492,6 +532,8 @@ void CreateProtoServices() { hServices[i++] = CreateProtoServiceFunction(MODULE, PSS_USERISTYPING, SendTyping);
hServices[i++] = CreateProtoServiceFunction(MODULE, PS_GETAVATARINFO, GetAvatarInfo);
+ hServices[i++] = CreateProtoServiceFunction(MODULE, PS_GETMYAVATAR, GetMyAvatar);
+ hServices[i++] = CreateProtoServiceFunction(MODULE, PS_GETAVATARCAPS, GetAvatarCaps);
// remember to modify the NUM_FILTER_SERVICES #define above if you add more services!
hEventContactDeleted = HookEvent(ME_DB_CONTACT_DELETED, ContactDeleted);
|