* add webcit database message ID to the notification template.
authorWilfried Göesgens <willi@citadel.org>
Tue, 26 May 2009 22:15:30 +0000 (22:15 +0000)
committerWilfried Göesgens <willi@citadel.org>
Tue, 26 May 2009 22:15:30 +0000 (22:15 +0000)
citadel/modules/extnotify/extnotify.h
citadel/modules/extnotify/extnotify_main.c
citadel/modules/extnotify/funambol65.c

index eab3e343a3e9b57e637b8313312eeba4f514883c..a88de1d6aa26501026957daa2a55e5ee86b33116 100644 (file)
@@ -15,7 +15,7 @@ extern "C" {
 
 #define FUNAMBOL_WS "/funambol/services/admin"
 
-int notify_funambol_server(char *user, char *msgid);
+int notify_funambol_server(char *user, char *msgid, long MsgNum);
 
 void extNotify_getPrefs(long configMsgNum, char *configMsg);
 long extNotify_getConfigMessage(char *username);
index 51a0f6febf403f3a07685af8ae24c8b698b0b774..f87c392c05fbf1e3e7420e048d04749f5a5755f8 100644 (file)
@@ -135,7 +135,8 @@ void process_notify(long msgnum, void *usrdata) {
     int extPagerAllowed = strncasecmp(configMsg, PAGER_CONFIG_TEXT, strlen(PAGER_CONFIG_TEXT)); 
     if (fnblAllowed == 0) {
            notify_funambol_server(msg->cm_fields['W'], 
-                                  msg->cm_fields['I']);
+                                  msg->cm_fields['I'],
+                                  msgnum);
     } else if (extPagerAllowed == 0) {
            char *number = strtok(configMsg, "textmessage\n");
            int commandSiz = sizeof(config.c_pager_program) + strlen(number) + strlen(msg->cm_fields['W']) + 5;
index 53a0487bbe45314967ec41aa45e6d4b8092efac1..2c37b67daa73e3630e11f301540fc8c81e5addff 100644 (file)
@@ -33,8 +33,9 @@
 * of new mail for a user
 * Returns 0 if unsuccessful
 */
-int notify_funambol_server(char *user, char *msgid) {
+int notify_funambol_server(char *user, char *msgid, long MsgNum) {
        char port[1024];
+       char msgnumstr[128];
        int sock = -1;
        char *buf = NULL;
        char *SOAPMessage = NULL;
@@ -73,7 +74,7 @@ int notify_funambol_server(char *user, char *msgid) {
                aide_message(buf, "External notifier unable to find message template!");
                goto free;
        }
-
+       snprintf(msgnumstr, 128, "%ld", MsgNum);
 
        buf = malloc(SIZ);
        memset(buf, 0, SIZ);
@@ -106,7 +107,8 @@ int notify_funambol_server(char *user, char *msgid) {
        help_subst(SOAPMessage, "^notifyuser", user);
        help_subst(SOAPMessage, "^syncsource", config.c_funambol_source);
        help_subst(SOAPMessage, "^msgid", msgid);
-       
+       help_subst(SOAPMessage, "^msgnum", msgnumstr);
+
        /* Build the HTTP request header */