summaryrefslogtreecommitdiff
path: root/MySpace
diff options
context:
space:
mode:
authorsje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2007-07-11 04:24:28 +0000
committersje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2007-07-11 04:24:28 +0000
commit01a664406e36abb810364237fda24e204265d7b4 (patch)
tree1ada68002da5da20997cefd7200e18a681948432 /MySpace
parent1b5156845a93913b3e125b0cf06e77f915f3d88f (diff)
fix reaction to global status modes
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@276 4f64403b-2f21-0410-a795-97e2b3489a10
Diffstat (limited to 'MySpace')
-rw-r--r--MySpace/server_con.cpp28
-rw-r--r--MySpace/version.h2
2 files changed, 26 insertions, 4 deletions
diff --git a/MySpace/server_con.cpp b/MySpace/server_con.cpp
index 5f140b2..b540b3a 100644
--- a/MySpace/server_con.cpp
+++ b/MySpace/server_con.cpp
@@ -57,8 +57,9 @@ bool WriteData(char *fn, int fn_size, char *data, int data_size) {
int stat_mir_to_myspace(int mir_status) {
switch(mir_status) {
case ID_STATUS_INVISIBLE: return 0;
- case ID_STATUS_AWAY: return 5;
case ID_STATUS_ONLINE: return 1;
+ case ID_STATUS_AWAY: return 5;
+
case ID_STATUS_IDLE: return 2;
}
return 0;
@@ -71,7 +72,27 @@ int stat_myspace_to_mir(int myspace_status) {
case 2: return ID_STATUS_IDLE;
case 5: return ID_STATUS_AWAY;
}
- return 0;
+ return ID_STATUS_OFFLINE;
+}
+
+// translate request to change to mode into actual mode
+int stat_mir_to_mir(int mir_status) {
+ switch(mir_status) {
+ case ID_STATUS_INVISIBLE: return ID_STATUS_INVISIBLE;
+ case ID_STATUS_ONLINE: return ID_STATUS_ONLINE;
+ case ID_STATUS_AWAY: return ID_STATUS_AWAY;
+
+ case ID_STATUS_DND: return ID_STATUS_AWAY;
+ case ID_STATUS_NA: return ID_STATUS_AWAY;
+ case ID_STATUS_OCCUPIED: return ID_STATUS_AWAY;
+ case ID_STATUS_ONTHEPHONE: return ID_STATUS_AWAY;
+ case ID_STATUS_OUTTOLUNCH: return ID_STATUS_AWAY;
+
+ case ID_STATUS_FREECHAT: return ID_STATUS_ONLINE;
+
+ case ID_STATUS_IDLE: return ID_STATUS_IDLE;
+ }
+ return ID_STATUS_OFFLINE;
}
HANDLE FindContact(int uid) {
@@ -477,7 +498,7 @@ void __cdecl ServerThreadFunc(void*) {
PipedStringList l = msg.get_list("msg");
int old_status = DBGetContactSettingWord(hContact, MODULE, "Status", ID_STATUS_OFFLINE),
new_status = ParseStatusMessage(hContact, l);
- if(status != ID_STATUS_INVISIBLE && old_status != new_status && new_status != ID_STATUS_OFFLINE) {
+ if(status != ID_STATUS_INVISIBLE && old_status == ID_STATUS_OFFLINE && new_status != ID_STATUS_OFFLINE) {
ClientNetMessage msg;
msg.add_int("bm", 200);
msg.add_int("sesskey", sesskey);
@@ -788,6 +809,7 @@ void SetServerStatus(int st) {
if(st == ID_STATUS_OFFLINE) {
StopThread();
} else {
+ st = stat_mir_to_mir(st);
if(myspace_server_running && sesskey) {
// set status
ClientNetMessage msg_status;
diff --git a/MySpace/version.h b/MySpace/version.h
index a4521ba..74807fa 100644
--- a/MySpace/version.h
+++ b/MySpace/version.h
@@ -5,7 +5,7 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 0
#define __RELEASE_NUM 4
-#define __BUILD_NUM 5
+#define __BUILD_NUM 6
#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
#define __FILEVERSION_STRING_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM