]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
skypopen: mark chatmessages SEEN
authorGiovanni Maruzzelli <gmaruzz@gmail.com>
Mon, 7 May 2012 16:57:40 +0000 (18:57 +0200)
committerGiovanni Maruzzelli <gmaruzz@gmail.com>
Mon, 7 May 2012 17:02:16 +0000 (19:02 +0200)
src/mod/endpoints/mod_skypopen/skypopen_protocol.c

index d8e9ffa9ff241a7f7ecf7d32292abfc539e8c3e9..4bb84505e0d888b3f0db8a40103b31e71d32d401 100644 (file)
@@ -356,7 +356,7 @@ int skypopen_signaling_read(private_t *tech_pvt)
                                                }
                                        }
                                        if (!found) {
-                                               DEBUGA_SKYPE("why we do not have a chats slot free? we have more than %d chats in parallel?\n", SKYPOPEN_P_LOG, MAX_CHATS);
+                                               ERRORA("why we do not have a chats slot free? we have more than %d chats in parallel?\n", SKYPOPEN_P_LOG, MAX_CHATS);
                                        }
 
                                        DEBUGA_SKYPE("CHAT %s is in position %d in the chats array, chatname=%s, dialog_partner=%s\n", SKYPOPEN_P_LOG, id, i,
@@ -378,6 +378,12 @@ int skypopen_signaling_read(private_t *tech_pvt)
                                skypopen_strncpy(prop, where, sizeof(prop) - 1);
                                skypopen_strncpy(value, *stringp, sizeof(value) - 1);
 
+ if (!tech_pvt->report_incoming_chatmessages) {
+                               if (!strcasecmp(prop, "STATUS") && !strcasecmp(value, "RECEIVED")) {
+                                       sprintf(msg_to_skype, "SET CHATMESSAGE %s SEEN", id);
+                                       skypopen_signaling_write(tech_pvt, msg_to_skype);
+                               }
+} else {
                                if (!strcasecmp(prop, "STATUS") && !strcasecmp(value, "RECEIVED")) {
                                        DEBUGA_SKYPE("RECEIVED CHATMESSAGE %s, let's see which type it is\n", SKYPOPEN_P_LOG, id);
                                        sprintf(msg_to_skype, "GET CHATMESSAGE %s TYPE", id);
@@ -396,7 +402,7 @@ int skypopen_signaling_read(private_t *tech_pvt)
                                                }
                                        }
                                        if (!found) {
-                                               DEBUGA_SKYPE("why we do not have a chatmessages slot free? we have more than %d chatmessages in parallel?\n", SKYPOPEN_P_LOG,
+                                               ERRORA("why we do not have a chatmessages slot free? we have more than %d chatmessages in parallel?\n", SKYPOPEN_P_LOG,
                                                                         MAX_CHATMESSAGES);
                                        } else {
                                                DEBUGA_SKYPE("CHATMESSAGE %s is in position %d in the chatmessages array, type=%s, id=%s\n", SKYPOPEN_P_LOG, id, i,
@@ -479,10 +485,14 @@ int skypopen_signaling_read(private_t *tech_pvt)
                                                if (strcmp(tech_pvt->chatmessages[i].from_handle, tech_pvt->skype_user)) {      //if the message was not sent by myself
                                                        incoming_chatmessage(tech_pvt, i);
                                                        memset(&tech_pvt->chatmessages[i], '\0', sizeof(&tech_pvt->chatmessages[i]));
+
+                                       sprintf(msg_to_skype, "SET CHATMESSAGE %s SEEN", id);
+                                       skypopen_signaling_write(tech_pvt, msg_to_skype);
                                                }
                                        }
 
                                }
+}
 
                        }