summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/FacebookRM')
-rw-r--r--protocols/FacebookRM/src/connection.cpp3
-rw-r--r--protocols/FacebookRM/src/proto.cpp3
-rw-r--r--protocols/FacebookRM/src/proto.h4
-rw-r--r--protocols/FacebookRM/src/version.h2
4 files changed, 10 insertions, 2 deletions
diff --git a/protocols/FacebookRM/src/connection.cpp b/protocols/FacebookRM/src/connection.cpp
index 02d267e375..1406a497f9 100644
--- a/protocols/FacebookRM/src/connection.cpp
+++ b/protocols/FacebookRM/src/connection.cpp
@@ -160,6 +160,9 @@ void FacebookProto::ChangeStatus(void*)
m_invisible = (new_status == ID_STATUS_INVISIBLE);
+ // Remember time of switching to away (and if we are idle already, use the idle time)
+ m_awayTS = (new_status == ID_STATUS_AWAY ? (m_idleTS > 0 ? m_idleTS : ::time(NULL)) : 0);
+
facy.chat_state(!m_invisible);
ForkThread(&FacebookProto::ProcessBuddyList, NULL);
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp
index da175d799a..de58eec7be 100644
--- a/protocols/FacebookRM/src/proto.cpp
+++ b/protocols/FacebookRM/src/proto.cpp
@@ -152,7 +152,7 @@ DWORD_PTR FacebookProto::GetCaps(int type, MCONTACT)
return flags |= PF1_MODEMSGRECV;
}
case PFLAGNUM_2:
- return PF2_ONLINE | PF2_INVISIBLE | PF2_ONTHEPHONE | PF2_IDLE; // | PF2_SHORTAWAY;
+ return PF2_ONLINE | PF2_SHORTAWAY | PF2_INVISIBLE | PF2_ONTHEPHONE | PF2_IDLE;
case PFLAGNUM_3:
if (getByte(FACEBOOK_KEY_SET_MIRANDA_STATUS))
return PF2_ONLINE; // | PF2_SHORTAWAY;
@@ -181,6 +181,7 @@ int FacebookProto::SetStatus(int new_status)
// Routing statuses not supported by Facebook
switch (new_status)
{
+ case ID_STATUS_AWAY:
case ID_STATUS_INVISIBLE:
case ID_STATUS_OFFLINE:
m_iDesiredStatus = new_status;
diff --git a/protocols/FacebookRM/src/proto.h b/protocols/FacebookRM/src/proto.h
index 9e4dafbab5..8ea23916cf 100644
--- a/protocols/FacebookRM/src/proto.h
+++ b/protocols/FacebookRM/src/proto.h
@@ -53,6 +53,9 @@ public:
inline int IdleSeconds()
{
+ if (m_iStatus == ID_STATUS_AWAY && m_awayTS)
+ return time(0) - m_awayTS;
+
return m_idleTS ? time(0) - m_idleTS : 0;
}
@@ -60,6 +63,7 @@ public:
bool m_enableChat;
bool m_signingOut;
time_t m_idleTS;
+ time_t m_awayTS;
time_t m_pingTS;
std::string m_locale;
diff --git a/protocols/FacebookRM/src/version.h b/protocols/FacebookRM/src/version.h
index 63bf5f3e18..eb5dbab1f6 100644
--- a/protocols/FacebookRM/src/version.h
+++ b/protocols/FacebookRM/src/version.h
@@ -1,7 +1,7 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 2
#define __RELEASE_NUM 11
-#define __BUILD_NUM 5
+#define __BUILD_NUM 6
#include <stdver.h>