Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/EionRobb/skype4pidgin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunker <dk-junker@ya.ru>2017-02-26 18:51:37 +0300
committerJunker <dk-junker@ya.ru>2017-02-26 18:51:37 +0300
commitec057ab63f34e626918d6c2e86ce0a7b616006c1 (patch)
tree073cf490fdd353f624ba81403708e76016cf3a80
parentf93d94f139f8915e222f43e4dd7b182979c4e443 (diff)
fix idle status problem
-rw-r--r--skypeweb/libskypeweb.c16
-rw-r--r--skypeweb/libskypeweb.h8
-rw-r--r--skypeweb/skypeweb_messages.c18
3 files changed, 30 insertions, 12 deletions
diff --git a/skypeweb/libskypeweb.c b/skypeweb/libskypeweb.c
index 38f7179..e003162 100644
--- a/skypeweb/libskypeweb.c
+++ b/skypeweb/libskypeweb.c
@@ -27,7 +27,7 @@ void
skypeweb_do_all_the_things(SkypeWebAccount *sa)
{
skypeweb_get_vdms_token(sa);
-
+
if (!sa->username) {
skypeweb_get_self_details(sa);
} else
@@ -126,17 +126,17 @@ skypeweb_status_types(PurpleAccount *account)
status = purple_status_type_new_full(PURPLE_STATUS_OFFLINE, NULL, NULL, FALSE, FALSE, FALSE);
types = g_list_append(types, status);
- status = purple_status_type_new_with_attrs(PURPLE_STATUS_AVAILABLE, "Online", _("Online"), TRUE, TRUE, FALSE, "message", "Mood", purple_value_new(PURPLE_TYPE_STRING), NULL);
- types = g_list_append(types, status);
- status = purple_status_type_new_with_attrs(PURPLE_STATUS_AWAY, "Idle", _("Away"), TRUE, TRUE, FALSE, "message", "Mood", purple_value_new(PURPLE_TYPE_STRING), NULL);
+ status = purple_status_type_new_with_attrs(PURPLE_STATUS_AVAILABLE, SKYPEWEB_STATUS_ONLINE, _("Online"), TRUE, TRUE, FALSE, "message", "Mood", purple_value_new(PURPLE_TYPE_STRING), NULL);
types = g_list_append(types, status);
- status = purple_status_type_new_with_attrs(PURPLE_STATUS_EXTENDED_AWAY, "Away", _("Not Available"), TRUE, TRUE, FALSE, "message", "Mood", purple_value_new(PURPLE_TYPE_STRING), NULL);
+ status = purple_status_type_new_with_attrs(PURPLE_STATUS_AWAY, SKYPEWEB_STATUS_AWAY, _("Away"), TRUE, TRUE, FALSE, "message", "Mood", purple_value_new(PURPLE_TYPE_STRING), NULL);
types = g_list_append(types, status);
- status = purple_status_type_new_with_attrs(PURPLE_STATUS_UNAVAILABLE, "Busy", _("Do Not Disturb"), TRUE, TRUE, FALSE, "message", "Mood", purple_value_new(PURPLE_TYPE_STRING), NULL);
+// status = purple_status_type_new_with_attrs(PURPLE_STATUS_EXTENDED_AWAY, SKYPEWEB_STATUS_AWAY, _("Not Available"), TRUE, TRUE, FALSE, "message", "Mood", purple_value_new(PURPLE_TYPE_STRING), NULL);
+// types = g_list_append(types, status);
+ status = purple_status_type_new_with_attrs(PURPLE_STATUS_UNAVAILABLE, SKYPEWEB_STATUS_BUSY, _("Do Not Disturb"), TRUE, TRUE, FALSE, "message", "Mood", purple_value_new(PURPLE_TYPE_STRING), NULL);
types = g_list_append(types, status);
- status = purple_status_type_new_with_attrs(PURPLE_STATUS_INVISIBLE, "Hidden", _("Invisible"), TRUE, TRUE, FALSE, "message", "Mood", purple_value_new(PURPLE_TYPE_STRING), NULL);
+ status = purple_status_type_new_with_attrs(PURPLE_STATUS_INVISIBLE, SKYPEWEB_STATUS_HIDDEN, _("Invisible"), TRUE, TRUE, FALSE, "message", "Mood", purple_value_new(PURPLE_TYPE_STRING), NULL);
types = g_list_append(types, status);
- status = purple_status_type_new_with_attrs(PURPLE_STATUS_OFFLINE, "Offline", _("Offline"), TRUE, TRUE, FALSE, "message", "Mood", purple_value_new(PURPLE_TYPE_STRING), NULL);
+ status = purple_status_type_new_with_attrs(PURPLE_STATUS_OFFLINE, SKYPEWEB_STATUS_OFFLINE, _("Offline"), TRUE, TRUE, FALSE, "message", "Mood", purple_value_new(PURPLE_TYPE_STRING), NULL);
types = g_list_append(types, status);
return types;
diff --git a/skypeweb/libskypeweb.h b/skypeweb/libskypeweb.h
index 0c28720..b24c98d 100644
--- a/skypeweb/libskypeweb.h
+++ b/skypeweb/libskypeweb.h
@@ -273,6 +273,14 @@ G_MODULE_EXPORT GType skypeweb_protocol_get_type(void);
#define SKYPEWEB_CLIENTINFO_NAME "swx-skype.com"
#define SKYPEWEB_CLIENTINFO_VERSION "908/1.63.51"
+#define SKYPEWEB_STATUS_ONLINE "Online"
+#define SKYPEWEB_STATUS_IDLE "Idle"
+#define SKYPEWEB_STATUS_AWAY "Away"
+#define SKYPEWEB_STATUS_BUSY "Busy"
+#define SKYPEWEB_STATUS_HIDDEN "Hidden"
+#define SKYPEWEB_STATUS_OFFLINE "Offline"
+
+
#define SKYPEWEB_BUDDY_IS_MSN(a) G_UNLIKELY((a) != NULL && strchr((a), '@') != NULL)
#define SKYPEWEB_BUDDY_IS_PHONE(a) G_UNLIKELY((a) != NULL && *(a) == '+')
#define SKYPEWEB_BUDDY_IS_S4B(a) G_UNLIKELY((a) != NULL && g_str_has_prefix((a), "2:"))
diff --git a/skypeweb/skypeweb_messages.c b/skypeweb/skypeweb_messages.c
index d100a60..3bb9133 100644
--- a/skypeweb/skypeweb_messages.c
+++ b/skypeweb/skypeweb_messages.c
@@ -1226,6 +1226,7 @@ skypeweb_get_vdms_token(SkypeWebAccount *sa)
skypeweb_fetch_url_request(sa, messages_url, TRUE, NULL, FALSE, request, FALSE, 524288, skypeweb_got_vdms_token, sa);
g_free(request);
+
}
@@ -1321,12 +1322,21 @@ skypeweb_set_status(PurpleAccount *account, PurpleStatus *status)
void
skypeweb_set_idle(PurpleConnection *pc, int time)
{
+ const gchar *status_id;
+ PurpleStatus *status;
+
SkypeWebAccount *sa = purple_connection_get_protocol_data(pc);
- if (time < 30) {
- skypeweb_set_statusid(sa, "Online");
- } else {
- skypeweb_set_statusid(sa, "Idle");
+ status = purple_account_get_active_status(purple_connection_get_account(pc));
+ status_id = purple_status_get_id(status);
+
+ /* Only go idle if active status is online */
+ if (!strcmp(status_id, SKYPEWEB_STATUS_ONLINE)) {
+ if (time < 30) {
+ skypeweb_set_statusid(sa, SKYPEWEB_STATUS_ONLINE);
+ } else {
+ skypeweb_set_statusid(sa, SKYPEWEB_STATUS_IDLE);
+ }
}
}