X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Fextnotify%2Fextnotify_main.c;fp=citadel%2Fmodules%2Fextnotify%2Fextnotify_main.c;h=826704cf45a68d771c0bfba7529d3eaf11b1f5b2;hb=951fbe7c1ee0b3554af22d6ae0d1d51c1642ae0f;hp=a519548faee6271acc0b03252c6e7d1f82544115;hpb=02226afa2dbdc2f08b1b10de890d75f35ca0dee0;p=citadel.git diff --git a/citadel/modules/extnotify/extnotify_main.c b/citadel/modules/extnotify/extnotify_main.c index a519548fa..826704cf4 100644 --- a/citadel/modules/extnotify/extnotify_main.c +++ b/citadel/modules/extnotify/extnotify_main.c @@ -185,8 +185,8 @@ eNotifyType extNotify_getConfigMessage(char *username, for (a = 0; a < num_msgs; ++a) { msg = CtdlFetchMessage(msglist[a], 1); if (msg != NULL) { - if ((msg->cm_fields['U'] != NULL) && - (strncasecmp(msg->cm_fields['U'], + if ((msg->cm_fields[eMsgSubject] != NULL) && + (strncasecmp(msg->cm_fields[eMsgSubject], PAGER_CONFIG_MESSAGE, strlen(PAGER_CONFIG_MESSAGE)) == 0)) { @@ -204,8 +204,8 @@ eNotifyType extNotify_getConfigMessage(char *username, // Do a simple string search to see if 'funambol' is selected as the // type. This string would be at the very top of the message contents. - configMsg = msg->cm_fields['M']; - msg->cm_fields['M'] = NULL; + configMsg = msg->cm_fields[eMesageText]; + msg->cm_fields[eMesageText] = NULL; CtdlFreeMessage(msg); /* here we would find the pager number... */ @@ -280,14 +280,14 @@ void process_notify(long NotifyMsgnum, void *usrdata) Ctx = (NotifyContext*) usrdata; msg = CtdlFetchMessage(NotifyMsgnum, 1); - if ( msg->cm_fields['2'] != NULL) + if ( msg->cm_fields[eExtnotify] != NULL) { Type = extNotify_getConfigMessage( - msg->cm_fields['2'], + msg->cm_fields[eExtnotify], &PagerNo, &FreeMe); - pch = strstr(msg->cm_fields['M'], "msgid|"); + pch = strstr(msg->cm_fields[eMesageText], "msgid|"); if (pch != NULL) msgnum = atol(pch + sizeof("msgid")); @@ -303,8 +303,8 @@ void process_notify(long NotifyMsgnum, void *usrdata) notify_http_server(remoteurl, file_funambol_msg, strlen(file_funambol_msg),/*GNA*/ - msg->cm_fields['2'], - msg->cm_fields['I'], + msg->cm_fields[eExtnotify], + msg->cm_fields[emessageId], msgnum, NULL); break; @@ -336,8 +336,8 @@ void process_notify(long NotifyMsgnum, void *usrdata) notify_http_server(URLBuf, ChrPtr(FileBuf), StrLength(FileBuf), - msg->cm_fields['2'], - msg->cm_fields['I'], + msg->cm_fields[eExtnotify], + msg->cm_fields[emessageId], msgnum, NULL); } @@ -351,7 +351,7 @@ void process_notify(long NotifyMsgnum, void *usrdata) commandSiz = sizeof(config.c_pager_program) + strlen(PagerNo) + - strlen(msg->cm_fields['2']) + 5; + strlen(msg->cm_fields[eExtnotify]) + 5; command = malloc(commandSiz); @@ -360,7 +360,7 @@ void process_notify(long NotifyMsgnum, void *usrdata) "%s %s -u %s", config.c_pager_program, PagerNo, - msg->cm_fields['2']); + msg->cm_fields[eExtnotify]); system(command); free(command);