long configMsgNum = extNotify_getConfigMessage(msg->cm_fields['W']);
char configMsg[SIZ];
- extNotify_getPrefs(configMsgNum, &configMsg);
+ extNotify_getPrefs(configMsgNum, &configMsg[0]);
/* Check to see if:
* 1. The user has configured paging / They have and disabled it
* 3. A Funambol server has been entered
*
*/
- if ((configMsgNum == -1) || (strncasecmp(configMsg, "none", 4) == 0) &&
- IsEmptyStr(config.c_pager_program) && IsEmptyStr(config.c_funambol_host)) {
+ if ((configMsgNum == -1) ||
+ ((strncasecmp(configMsg, "none", 4) == 0) &&
+ IsEmptyStr(config.c_pager_program) &&
+ IsEmptyStr(config.c_funambol_host))) {
CtdlLogPrintf(CTDL_DEBUG, "No external notifiers configured on system/user");
goto nuke;
}
int fnblAllowed = strncasecmp(configMsg, FUNAMBOL_CONFIG_TEXT, strlen(FUNAMBOL_CONFIG_TEXT));
int extPagerAllowed = strncasecmp(configMsg, PAGER_CONFIG_TEXT, strlen(PAGER_CONFIG_TEXT));
if (fnblAllowed == 0) {
- notify_funambol_server(msg->cm_fields['W']);
+ notify_funambol_server(msg->cm_fields['W'],
+ msg->cm_fields['I']);
} 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;
- char *command = malloc(commandSiz);
- snprintf(command, commandSiz, "%s %s -u %s", config.c_pager_program, number, msg->cm_fields['W']);
- system(command);
- free(command);
+ char *number = strtok(configMsg, "textmessage\n");
+ int commandSiz = sizeof(config.c_pager_program) + strlen(number) + strlen(msg->cm_fields['W']) + 5;
+ char *command = malloc(commandSiz);
+ snprintf(command, commandSiz, "%s %s -u %s", config.c_pager_program, number, msg->cm_fields['W']);
+ system(command);
+ free(command);
}
- nuke:
+nuke:
CtdlFreeMessage(msg);
memset(configMsg, 0, sizeof(configMsg));
long todelete[1];
/*! \brief Checks to see what notification option the user has set
*
*/
-char *extNotify_getPrefs(long configMsgNum, char *configMsg) {
+void extNotify_getPrefs(long configMsgNum, char *configMsg) {
// 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.
if (configMsgNum == -1) {
CtdlLogPrintf(CTDL_ERR, "extNotify_isAllowedByPrefs was passed a non-existant config message id\n");
- return "none";
+ return;
}
struct CtdlMessage *prefMsg;
prefMsg = CtdlFetchMessage(configMsgNum, 1);
strncpy(configMsg, prefMsg->cm_fields['M'], strlen(prefMsg->cm_fields['M']));
CtdlFreeMessage(prefMsg);
- return configMsg;
}
/*! \brief Get configuration message for pager/funambol system from the
* users "My Citadel Config" room
CtdlRegisterSessionHook(do_extnotify_queue, EVT_TIMER);
}
/* return our Subversion id for the Log */
- return "$Id: $";
+ return "$Id$";
}