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:
authorEion Robb <eion@robbmob.com>2017-02-25 15:01:54 +0300
committerGitHub <noreply@github.com>2017-02-25 15:01:54 +0300
commit04026bb418c57b8bd9f7f8923024491525278f2b (patch)
treec133228f588bee1e0cae6a88e00b66f1f1d6e680
parente77440568a353190a6a6edba73ea989c2260d871 (diff)
parent5406f1f9cc360ebb65b9d3785ea3e8bcbc244602 (diff)
Merge pull request #525 from Junker/master
show system message when call received
-rw-r--r--skypeweb/skypeweb_messages.c82
1 files changed, 51 insertions, 31 deletions
diff --git a/skypeweb/skypeweb_messages.c b/skypeweb/skypeweb_messages.c
index d61ef1c..1cfc912 100644
--- a/skypeweb/skypeweb_messages.c
+++ b/skypeweb/skypeweb_messages.c
@@ -437,45 +437,65 @@ process_message_resource(SkypeWebAccount *sa, JsonObject *resource)
(void) incoming;
from = convbuddyname;
}
- if (partlisttype && from != NULL) {
- imconv = purple_conversations_find_im_with_account(from, sa->account);
- if (imconv == NULL)
- {
- imconv = purple_im_conversation_new(sa->account, from);
- }
-
- conv = PURPLE_CONVERSATION(imconv);
- if (g_str_equal(partlisttype, "started")) {
- message = _("Call started");
- } else if (g_str_equal(partlisttype, "ended")) {
- PurpleXmlNode *part;
- gint duration_int = -1;
-
- for(part = purple_xmlnode_get_child(partlist, "part");
- part;
- part = purple_xmlnode_get_next_twin(part))
+
+ if (from != NULL) {
+ if (partlisttype) {
+ imconv = purple_conversations_find_im_with_account(from, sa->account);
+ if (imconv == NULL)
{
- const gchar *identity = purple_xmlnode_get_attrib(part, "identity");
- if (identity && skypeweb_is_user_self(sa, identity)) {
- PurpleXmlNode *duration = purple_xmlnode_get_child(part, "duration");
- if (duration != NULL) {
- gchar *duration_str;
- duration_str = purple_xmlnode_get_data(duration);
- duration_int = atoi(duration_str);
- break;
+ imconv = purple_im_conversation_new(sa->account, from);
+ }
+
+ conv = PURPLE_CONVERSATION(imconv);
+ if (g_str_equal(partlisttype, "started")) {
+ message = _("Call started");
+ } else if (g_str_equal(partlisttype, "ended")) {
+ PurpleXmlNode *part;
+ gint duration_int = -1;
+
+ for(part = purple_xmlnode_get_child(partlist, "part");
+ part;
+ part = purple_xmlnode_get_next_twin(part))
+ {
+ const gchar *identity = purple_xmlnode_get_attrib(part, "identity");
+ if (identity && skypeweb_is_user_self(sa, identity)) {
+ PurpleXmlNode *duration = purple_xmlnode_get_child(part, "duration");
+ if (duration != NULL) {
+ gchar *duration_str;
+ duration_str = purple_xmlnode_get_data(duration);
+ duration_int = atoi(duration_str);
+ break;
+ }
}
}
- }
- if (duration_int < 0) {
- message = _("Call missed");
- } else {
- //TODO report how long the call was
- message = _("Call ended");
+ if (duration_int < 0) {
+ message = _("Call missed");
+ } else {
+ //TODO report how long the call was
+ message = _("Call ended");
+ }
}
}
+ else {
+ message = _("Unsupported call received");
+ }
+
purple_serv_got_im(sa->pc, from, message, PURPLE_MESSAGE_RECV | PURPLE_MESSAGE_SYSTEM, composetimestamp);
}
+
purple_xmlnode_free(partlist);
+ } else if (g_str_equal(messagetype, "Signal/Flamingo")) {
+ const gchar *message = NULL;
+
+ if (skypeweb_is_user_self(sa, from)) {
+ from = convbuddyname;
+ }
+
+ if (from != NULL) {
+ message = _("Unsupported call received");
+
+ purple_serv_got_im(sa->pc, from, message, PURPLE_MESSAGE_RECV | PURPLE_MESSAGE_SYSTEM, composetimestamp);
+ }
} else if (g_str_equal(messagetype, "RichText/Files")) {
purple_serv_got_im(sa->pc, convbuddyname, _("The user sent files in an unsupported way"), PURPLE_MESSAGE_RECV | PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_ERROR, composetimestamp);
} else {