From be37284f66b73a6e4a09d967a9f0e4f9ab2ad368 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Tue, 26 May 2009 22:15:30 +0000 Subject: [PATCH] * add webcit database message ID to the notification template. --- citadel/modules/extnotify/extnotify.h | 2 +- citadel/modules/extnotify/extnotify_main.c | 3 ++- citadel/modules/extnotify/funambol65.c | 8 +++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/citadel/modules/extnotify/extnotify.h b/citadel/modules/extnotify/extnotify.h index eab3e343a..a88de1d6a 100644 --- a/citadel/modules/extnotify/extnotify.h +++ b/citadel/modules/extnotify/extnotify.h @@ -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); diff --git a/citadel/modules/extnotify/extnotify_main.c b/citadel/modules/extnotify/extnotify_main.c index 51a0f6feb..f87c392c0 100644 --- a/citadel/modules/extnotify/extnotify_main.c +++ b/citadel/modules/extnotify/extnotify_main.c @@ -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; diff --git a/citadel/modules/extnotify/funambol65.c b/citadel/modules/extnotify/funambol65.c index 53a0487bb..2c37b67da 100644 --- a/citadel/modules/extnotify/funambol65.c +++ b/citadel/modules/extnotify/funambol65.c @@ -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 */ -- 2.30.2