From: Wilfried Göesgens Date: Tue, 14 Jul 2009 21:54:25 +0000 (+0000) Subject: * notify about the actual message number, not the queue message ID X-Git-Tag: v7.86~986 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=027aab3f8d1977ac831f33abe4486a30ca224dbf * notify about the actual message number, not the queue message ID --- diff --git a/citadel/modules/extnotify/extnotify_main.c b/citadel/modules/extnotify/extnotify_main.c index 0f85dfc77..e06c07e18 100644 --- a/citadel/modules/extnotify/extnotify_main.c +++ b/citadel/modules/extnotify/extnotify_main.c @@ -161,8 +161,9 @@ void do_extnotify_queue(void) { /*! * \brief Process messages in the external notification queue */ -void process_notify(long msgnum, void *usrdata) +void process_notify(long NotifyMsgnum, void *usrdata) { + long msgnum; long todelete[1]; int fnblAllowed; int extPagerAllowedHttp; @@ -175,7 +176,7 @@ void process_notify(long msgnum, void *usrdata) NotifyHostList = (StrBuf**) usrdata; - msg = CtdlFetchMessage(msgnum, 1); + msg = CtdlFetchMessage(NotifyMsgnum, 1); if ( msg->cm_fields['W'] == NULL) { goto nuke; } @@ -205,7 +206,9 @@ void process_notify(long msgnum, void *usrdata) fnblAllowed = strncasecmp(configMsg, HKEY(FUNAMBOL_CONFIG_TEXT)); extPagerAllowedHttp = strncasecmp(configMsg, HKEY(PAGER_CONFIG_HTTP)); extPagerAllowedSystem = strncasecmp(configMsg, HKEY(PAGER_CONFIG_SYSTEM)); - + pch = strstr(msg->cm_fields['M'], "msgid|"); + if (pch != NULL) + msgnum = atol(pch + sizeof("msgid")); if (fnblAllowed == 0) { char remoteurl[SIZ]; snprintf(remoteurl, SIZ, "http://%s@%s:%d/%s", @@ -267,7 +270,7 @@ void process_notify(long msgnum, void *usrdata) nuke: CtdlFreeMessage(msg); memset(configMsg, 0, sizeof(configMsg)); - todelete[0] = msgnum; + todelete[0] = NotifyMsgnum; CtdlDeleteMessages(FNBL_QUEUE_ROOM, todelete, 1, ""); }