[Freeswitch-svn] [commit] r11111 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax

FreeSWITCH SVN gmaruzz at freeswitch.org
Sat Jan 10 04:18:35 PST 2009


Author: gmaruzz
Date: Sat Jan 10 06:18:35 2009
New Revision: 11111

Log:
skypiax: always (will be under config param) mark the MESSAGE received by Skype client as SEEN (READ) and so deleting them from the unread list

Modified:
   freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c

Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c	Sat Jan 10 06:18:35 2009
@@ -1365,26 +1365,65 @@
             }
           }
 
-          if (!strcasecmp(messaggio, "USER")) {
-            strncpy(obj, where, sizeof(obj) - 1);
+	  if (!strcasecmp(messaggio, "USER")) {
+		  strncpy(obj, where, sizeof(obj) - 1);
 
-            where = strsep(stringp, " ");
+		  where = strsep(stringp, " ");
 
-            strncpy(id, where, sizeof(id) - 1);
+		  strncpy(id, where, sizeof(id) - 1);
 
-            where = strsep(stringp, " ");
+		  where = strsep(stringp, " ");
 
-            strncpy(prop, where, sizeof(prop) - 1);
+		  strncpy(prop, where, sizeof(prop) - 1);
 
-            if (!strcasecmp(prop,"RECEIVEDAUTHREQUEST" )) {
-		    char msg_to_skype[256];
-              DEBUGA_SKYPE ("Skype MSG: messaggio: %s, obj: %s, id: %s, prop: %s!\n", SKYPIAX_P_LOG, messaggio, obj, id, prop);
+		  if (!strcasecmp(prop,"RECEIVEDAUTHREQUEST" )) {
+			  char msg_to_skype[256];
+			  DEBUGA_SKYPE ("Skype MSG: messaggio: %s, obj: %s, id: %s, prop: %s!\n", SKYPIAX_P_LOG, messaggio, obj, id, prop);
 
-	      //FIXME: TODO: allow authorization based on config param
-                    sprintf(msg_to_skype, "SET USER %s ISAUTHORIZED TRUE", id);
-                    skypiax_skype_write(p, msg_to_skype);
-            }
-          }
+			  //FIXME: TODO: allow authorization based on config param
+			  sprintf(msg_to_skype, "SET USER %s ISAUTHORIZED TRUE", id);
+			  skypiax_skype_write(p, msg_to_skype);
+		  }
+	  }
+
+
+	  if (!strcasecmp(messaggio, "MESSAGE")) {
+		  strncpy(obj, where, sizeof(obj) - 1);
+
+		  where = strsep(stringp, " ");
+
+		  strncpy(id, where, sizeof(id) - 1);
+
+		  where = strsep(stringp, " ");
+
+		  strncpy(prop, where, sizeof(prop) - 1);
+
+		  if (!strcasecmp(prop,"STATUS" )) {
+
+			  where = strsep(stringp, " ");
+
+			  strncpy(value, where, sizeof(value) - 1);
+
+
+			  if (!strcasecmp(value,"RECEIVED" )) {
+				  char msg_to_skype[256];
+				  DEBUGA_SKYPE ("Skype MSG: messaggio: %s, obj: %s, id: %s, prop: %s value: %s!\n", SKYPIAX_P_LOG, messaggio, obj, id, prop, value);
+
+				  //FIXME: TODO: allow authorization based on config param
+				  sprintf(msg_to_skype, "SET MESSAGE %s SEEN", id);
+				  skypiax_skype_write(p, msg_to_skype);
+			  }
+		  } else if (!strcasecmp(prop,"BODY" )) {
+			  char msg_to_skype[256];
+
+			  DEBUGA_SKYPE ("Skype MSG: messaggio: %s, obj: %s, id: %s, prop: %s!\n", SKYPIAX_P_LOG, messaggio, obj, id, prop);
+
+			  //FIXME: TODO: on config param ???
+			  sprintf(msg_to_skype, "SET MESSAGE %s SEEN", id);
+			  skypiax_skype_write(p, msg_to_skype);
+		  }
+
+	  }
 
 
           if (!strcasecmp(messaggio, "CALL")) {



More information about the Freeswitch-svn mailing list