From a7ba5521416e2e2d8f84065e2f5411450c612607 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 1 May 2015 17:42:19 -0400 Subject: [PATCH] Migrated many other files to the new config system --- citadel/modules/ctdlproto/serv_user.c | 18 +++++----- .../modules/eventclient/serv_eventclient.c | 33 ++++++++----------- citadel/modules/expire/expire_policy.c | 7 ++-- citadel/modules/extnotify/extnotify_main.c | 22 +++++-------- citadel/modules/extnotify/funambol65.c | 13 ++------ citadel/modules/fulltext/serv_fulltext.c | 6 ++-- citadel/modules/imap/imap_fetch.c | 26 +++++++-------- citadel/modules/imap/imap_misc.c | 26 +++++---------- citadel/modules/imap/imap_search.c | 24 +++++--------- citadel/modules/imap/serv_imap.c | 14 +++----- citadel/modules/instmsg/serv_instmsg.c | 13 ++++---- .../modules/managesieve/serv_managesieve.c | 4 +-- 12 files changed, 82 insertions(+), 124 deletions(-) diff --git a/citadel/modules/ctdlproto/serv_user.c b/citadel/modules/ctdlproto/serv_user.c index e98daad9f..7d6b18c6c 100644 --- a/citadel/modules/ctdlproto/serv_user.c +++ b/citadel/modules/ctdlproto/serv_user.c @@ -1,7 +1,7 @@ /* * Server functions which perform operations on user objects. * - * Copyright (c) 1987-2011 by the citadel.org team + * Copyright (c) 1987-2015 by the citadel.org team * * This program is open source software; you can redistribute it and/or * modify it under the terms of the GNU General Public License, version 3. @@ -15,14 +15,12 @@ #include "support.h" #include "control.h" #include "ctdl_module.h" - #include "citserver.h" - +#include "config.h" #include "user_ops.h" #include "internet_addressing.h" - /* * USER cmd */ @@ -47,7 +45,7 @@ void cmd_user(char *cmdbuf) "Too many users are already online " "(maximum is %d)\n", ERROR + MAX_SESSIONS_EXCEEDED, - config.c_nodename, config.c_maxsessions); + CtdlGetConfigStr("c_nodename"), CtdlGetConfigInt("c_maxsessions")); return; case login_ok: cprintf("%d Password required for %s\n", @@ -99,13 +97,13 @@ void cmd_newu(char *cmdbuf) long len; char username[SIZ]; - if (config.c_auth_mode != AUTHMODE_NATIVE) { + if (CtdlGetConfigInt("c_auth_mode") != AUTHMODE_NATIVE) { cprintf("%d This system does not use native mode authentication.\n", ERROR + NOT_HERE); return; } - if (config.c_disable_newu) { + if (CtdlGetConfigInt("c_disable_newu")) { cprintf("%d Self-service user account creation " "is disabled on this system.\n", ERROR + NOT_HERE); return; @@ -118,7 +116,7 @@ void cmd_newu(char *cmdbuf) if (CC->nologin) { cprintf("%d %s: Too many users are already online (maximum is %d)\n", ERROR + MAX_SESSIONS_EXCEEDED, - config.c_nodename, config.c_maxsessions); + CtdlGetConfigStr("c_nodename"), CtdlGetConfigInt("c_maxsessions")); return; } extract_token(username, cmdbuf, 0, '|', sizeof username); @@ -232,7 +230,7 @@ void cmd_creu(char *cmdbuf) } else if (a == ERROR + ALREADY_EXISTS) { cprintf("%d '%s' already exists.\n", ERROR + ALREADY_EXISTS, username); return; - } else if ( (config.c_auth_mode != AUTHMODE_NATIVE) && (a == ERROR + NO_SUCH_USER) ) { + } else if ( (CtdlGetConfigInt("c_auth_mode") != AUTHMODE_NATIVE) && (a == ERROR + NO_SUCH_USER) ) { cprintf("%d User accounts are not created within Citadel in host authentication mode.\n", ERROR + NO_SUCH_USER); return; @@ -372,7 +370,7 @@ void cmd_invt_kick(char *iuser, int op) { return; } - if (!strncasecmp(CC->room.QRname, config.c_baseroom, + if (!strncasecmp(CC->room.QRname, CtdlGetConfigStr("c_baseroom"), ROOMNAMELEN)) { cprintf("%d Can't add/remove users from this room.\n", ERROR + NOT_HERE); diff --git a/citadel/modules/eventclient/serv_eventclient.c b/citadel/modules/eventclient/serv_eventclient.c index f7e286a9a..22a715615 100644 --- a/citadel/modules/eventclient/serv_eventclient.c +++ b/citadel/modules/eventclient/serv_eventclient.c @@ -1,19 +1,13 @@ /* - * Copyright (c) 1998-2012 by the citadel.org team + * Copyright (c) 1998-2015 by the citadel.org team * - * This program is open source software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3. - * - * + * This program is open source software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 3. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * - * - * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. */ #include "sysdep.h" @@ -53,9 +47,8 @@ #include "server.h" #include "citserver.h" #include "support.h" - #include "ctdl_module.h" - +#include "config.h" #include "event_client.h" #include "serv_curl.h" @@ -477,13 +470,13 @@ int evcurl_init(AsyncIO *IO) OPT(WRITEDATA, (void *)IO); OPT(ERRORBUFFER, IO->HttpReq.errdesc); - if ((!IsEmptyStr(config.c_ip_addr)) - && (strcmp(config.c_ip_addr, "*")) - && (strcmp(config.c_ip_addr, "::")) - && (strcmp(config.c_ip_addr, "0.0.0.0")) + if ((!IsEmptyStr(CtdlGetConfigStr("c_ip_addr"))) + && (strcmp(CtdlGetConfigStr("c_ip_addr"), "*")) + && (strcmp(CtdlGetConfigStr("c_ip_addr"), "::")) + && (strcmp(CtdlGetConfigStr("c_ip_addr"), "0.0.0.0")) ) { - OPT(INTERFACE, config.c_ip_addr); + OPT(INTERFACE, CtdlGetConfigStr("c_ip_addr")); } #ifdef CURLOPT_HTTP_CONTENT_DECODING diff --git a/citadel/modules/expire/expire_policy.c b/citadel/modules/expire/expire_policy.c index bc4b772a7..f3b27df7f 100644 --- a/citadel/modules/expire/expire_policy.c +++ b/citadel/modules/expire/expire_policy.c @@ -1,6 +1,6 @@ /* * Functions which manage expire policy for rooms - * Copyright (c) 1987-2012 by the citadel.org team + * Copyright (c) 1987-2015 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 3. @@ -40,7 +40,7 @@ #include "support.h" #include "msgbase.h" #include "citserver.h" - +#include "config.h" #include "ctdl_module.h" #include "user_ops.h" @@ -72,8 +72,7 @@ void GetExpirePolicy(struct ExpirePolicy *epbuf, struct ctdlroom *qrbuf) { */ if (qrbuf->QRflags & QR_MAILBOX) { if (config.c_mbxep.expire_mode != 0) { - memcpy(epbuf, &config.c_mbxep, - sizeof(struct ExpirePolicy)); + memcpy(epbuf, &config.c_mbxep, sizeof(struct ExpirePolicy)); return; } } diff --git a/citadel/modules/extnotify/extnotify_main.c b/citadel/modules/extnotify/extnotify_main.c index 8eafc036a..219a03fa1 100644 --- a/citadel/modules/extnotify/extnotify_main.c +++ b/citadel/modules/extnotify/extnotify_main.c @@ -8,7 +8,7 @@ * Based on bits of serv_funambol * Contact: / * - * Copyright (c) 2008-2011 + * Copyright (c) 2008-2015 * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,10 +19,6 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -295,9 +291,9 @@ void process_notify(long NotifyMsgnum, void *usrdata) { case eFunambol: snprintf(remoteurl, SIZ, "http://%s@%s:%d/%s", - config.c_funambol_auth, - config.c_funambol_host, - config.c_funambol_port, + CtdlGetConfigStr("c_funambol_auth"), + CtdlGetConfigStr("c_funambol_host"), + CtdlGetConfigInt("c_funambol_port"), FUNAMBOL_WS); notify_http_server(remoteurl, @@ -349,7 +345,7 @@ void process_notify(long NotifyMsgnum, void *usrdata) int commandSiz; char *command; - commandSiz = sizeof(config.c_pager_program) + + commandSiz = sizeof(CtdlGetConfigStr("c_pager_program")) + strlen(PagerNo) + msg->cm_lengths[eExtnotify] + 5; @@ -358,7 +354,7 @@ void process_notify(long NotifyMsgnum, void *usrdata) snprintf(command, commandSiz, "%s %s -u %s", - config.c_pager_program, + CtdlGetConfigStr("c_pager_program"), PagerNo, msg->cm_fields[eExtnotify]); @@ -393,8 +389,8 @@ void do_extnotify_queue(void) * don't really require extremely fine granularity here, we'll do it * with a static variable instead. */ - if (IsEmptyStr(config.c_pager_program) && - IsEmptyStr(config.c_funambol_host)) + if (IsEmptyStr(CtdlGetConfigStr("c_pager_program")) && + IsEmptyStr(CtdlGetConfigStr("c_funambol_host"))) { syslog(LOG_ERR, "No external notifiers configured on system/user\n"); @@ -472,7 +468,7 @@ int extnotify_after_mbox_save(struct CtdlMessage *msg, /* If this is private, local mail, make a copy in the * recipient's mailbox and bump the reference count. */ - if (!IsEmptyStr(config.c_funambol_host) || !IsEmptyStr(config.c_pager_program)) + if (!IsEmptyStr(CtdlGetConfigStr("c_funambol_host")) || !IsEmptyStr(CtdlGetConfigStr("c_pager_program"))) { /* Generate a instruction message for the Funambol notification * server, in the same style as the SMTP queue diff --git a/citadel/modules/extnotify/funambol65.c b/citadel/modules/extnotify/funambol65.c index 20246c90d..1a1099719 100644 --- a/citadel/modules/extnotify/funambol65.c +++ b/citadel/modules/extnotify/funambol65.c @@ -8,21 +8,15 @@ * Based on bits of the previous serv_funambol * Contact: / * - * Copyright (c) 2008-2010 + * Copyright (c) 2008-2015 * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3. - * - * * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * - * - * */ #include @@ -146,8 +140,7 @@ int notify_http_server(char *remoteurl, // Do substitutions help_subst(SOAPMessage, "^notifyuser", user); - help_subst(SOAPMessage, "^syncsource", - config.c_funambol_source); + help_subst(SOAPMessage, "^syncsource", CtdlGetConfigStr("c_funambol_source")); help_subst(SOAPMessage, "^msgid", msgid); help_subst(SOAPMessage, "^msgnum", msgnumstr); @@ -182,7 +175,7 @@ int notify_http_server(char *remoteurl, } else { help_subst(remoteurl, "^notifyuser", user); - help_subst(remoteurl, "^syncsource", config.c_funambol_source); + help_subst(remoteurl, "^syncsource", CtdlGetConfigStr("c_funambol_source")); help_subst(remoteurl, "^msgid", msgid); help_subst(remoteurl, "^msgnum", msgnumstr); diff --git a/citadel/modules/fulltext/serv_fulltext.c b/citadel/modules/fulltext/serv_fulltext.c index 7f5da0fe8..8029b7583 100644 --- a/citadel/modules/fulltext/serv_fulltext.c +++ b/citadel/modules/fulltext/serv_fulltext.c @@ -251,7 +251,7 @@ void do_fulltext_indexing(void) { /* * Don't do this if the site doesn't have it enabled. */ - if (!config.c_enable_fulltext) { + if (!CtdlGetConfigInt("c_enable_fulltext")) { return; } @@ -455,7 +455,7 @@ void cmd_srch(char *argbuf) { if (CtdlAccessCheck(ac_logged_in)) return; - if (!config.c_enable_fulltext) { + if (!CtdlGetConfigInt("c_enable_fulltext")) { cprintf("%d Full text index is not enabled on this server.\n", ERROR + CMD_NOT_SUPPORTED); return; @@ -489,7 +489,7 @@ void ft_delete_remove(char *room, long msgnum) if (room) return; /* Remove from fulltext index */ - if (config.c_enable_fulltext) { + if (CtdlGetConfigInt("c_enable_fulltext")) { ft_index_message(msgnum, 0); } } diff --git a/citadel/modules/imap/imap_fetch.c b/citadel/modules/imap/imap_fetch.c index 3f00d3f3f..6708fbc4e 100644 --- a/citadel/modules/imap/imap_fetch.c +++ b/citadel/modules/imap/imap_fetch.c @@ -2,21 +2,17 @@ * Implements the FETCH command in IMAP. * This is a good example of the protocol's gratuitous complexity. * - * Copyright (c) 2001-2011 by the citadel.org team + * Copyright (c) 2001-2015 by the citadel.org team * - * This program is open source software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. + * This program is open source software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. */ @@ -363,8 +359,8 @@ void imap_output_envelope_from(struct CtdlMessage *msg) { process_rfc822_addr(msg->cm_fields[erFc822Addr], user, node, name); IPutStr(user, strlen(user)); /* mailbox name (user id) */ IAPuts(" "); - if (!strcasecmp(node, config.c_nodename)) { - IPutStr(CFG_KEY(c_fqdn)); + if (!strcasecmp(node, CtdlGetConfigStr("c_nodename"))) { + IPutStr(CtdlGetConfigStr("c_fqdn"), strlen(CtdlGetConfigStr("c_fqdn"))); } else { IPutStr(node, strlen(node)); /* host name */ diff --git a/citadel/modules/imap/imap_misc.c b/citadel/modules/imap/imap_misc.c index f4d501c9d..366526455 100644 --- a/citadel/modules/imap/imap_misc.c +++ b/citadel/modules/imap/imap_misc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1987-2011 by the citadel.org team + * Copyright (c) 1987-2015 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -10,10 +10,6 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -341,7 +337,7 @@ void imap_append(int num_parms, ConstStr *Params) { IUnbuffer (); - client_read_blob(Imap->TransmittedMessage, literal_length, config.c_sleeping); + client_read_blob(Imap->TransmittedMessage, literal_length, CtdlGetConfigInt("c_sleeping")); if ((ret < 0) || (StrLength(Imap->TransmittedMessage) < literal_length)) { IReply("NO Read failed."); @@ -377,19 +373,15 @@ void imap_append(int num_parms, ConstStr *Params) { CtdlUserGoto(roomname, 0, 0, &msgs, &new, NULL, NULL); /* If the user is locally authenticated, FORCE the From: header to - * show up as the real sender. FIXME do we really want to do this? - * Probably should make it site-definable or even room-definable. - * - * For now, we allow "forgeries" if the room is one of the user's - * private mailboxes. + * show up as the real sender. (Configurable setting) */ if (CCC->logged_in) { - if ( ((CCC->room.QRflags & QR_MAILBOX) == 0) && (config.c_imap_keep_from == 0)) { - - CM_SetField(msg, eAuthor, CCC->user.fullname, strlen(CCC->user.fullname)); - CM_SetField(msg, eNodeName, CFG_KEY(c_nodename)); - CM_SetField(msg, eHumanNode, CFG_KEY(c_humannode)); - } + if ( ((CCC->room.QRflags & QR_MAILBOX) == 0) && (CtdlGetConfigInt("c_imap_keep_from") == 0)) + { + CM_SetField(msg, eAuthor, CCC->user.fullname, strlen(CCC->user.fullname)); + CM_SetField(msg, eNodeName, CtdlGetConfigStr("c_nodename"), strlen(CtdlGetConfigStr("c_nodename"))); + CM_SetField(msg, eHumanNode, CtdlGetConfigStr("c_humannode"), strlen(CtdlGetConfigStr("c_humannode"))); + } } /* diff --git a/citadel/modules/imap/imap_search.c b/citadel/modules/imap/imap_search.c index cad499ceb..02240b1e8 100644 --- a/citadel/modules/imap/imap_search.c +++ b/citadel/modules/imap/imap_search.c @@ -1,21 +1,15 @@ /* * Implements IMAP's gratuitously complex SEARCH command. * - * Copyright (c) 2001-2012 by the citadel.org team + * Copyright (c) 2001-2015 by the citadel.org team * - * This program is open source software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3. - * - * + * This program is open source software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 3. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * - * - * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. */ #include "ctdl_module.h" @@ -157,7 +151,7 @@ int imap_do_search_msg(int seq, struct CtdlMessage *supplied_msg, /* If fulltext indexing is active, on this server, * all messages have already been qualified. */ - if (config.c_enable_fulltext) { + if (CtdlGetConfigInt("c_enable_fulltext")) { match = 1; } @@ -571,7 +565,7 @@ void imap_do_search(int num_items, ConstStr *itemlist, int is_uid) { * text index to disqualify messages that don't have any chance of * matching. (Only do this if the index is enabled!!) */ - if (config.c_enable_fulltext) for (i=0; i<(num_items-1); ++i) { + if (CtdlGetConfigInt("c_enable_fulltext")) for (i=0; i<(num_items-1); ++i) { if (!strcasecmp(itemlist[i].Key, "BODY")) { CtdlModuleDoSearch(&fts_num_msgs, &fts_msgs, itemlist[i+1].Key, "fulltext"); if (fts_num_msgs > 0) { diff --git a/citadel/modules/imap/serv_imap.c b/citadel/modules/imap/serv_imap.c index 278cc7332..34c175dcb 100644 --- a/citadel/modules/imap/serv_imap.c +++ b/citadel/modules/imap/serv_imap.c @@ -1,7 +1,7 @@ /* * IMAP server for the Citadel system * - * Copyright (C) 2000-2011 by Art Cancro and others. + * Copyright (C) 2000-2015 by Art Cancro and others. * This code is released under the terms of the GNU General Public License. * * WARNING: the IMAP protocol is badly designed. No implementation of it @@ -17,10 +17,6 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "sysdep.h" @@ -599,7 +595,7 @@ void imap_greeting(void) IAPuts("* OK ["); imap_output_capability_string(); - IAPrintf("] %s IMAP4rev1 %s ready\r\n", config.c_fqdn, CITADEL); + IAPrintf("] %s IMAP4rev1 %s ready\r\n", CtdlGetConfigStr("c_fqdn"), CITADEL); IUnbuffer(); } @@ -1675,7 +1671,7 @@ void imap_logout(int num_parms, ConstStr *Params) if (IMAP->selected) { imap_do_expunge(); /* yes, we auto-expunge at logout */ } - IAPrintf("* BYE %s logging out\r\n", config.c_fqdn); + IAPrintf("* BYE %s logging out\r\n", CtdlGetConfigStr("c_fqdn")); IReply("OK Citadel IMAP session ended."); CC->kill_me = KILLME_CLIENT_LOGGED_OUT; return; @@ -1744,10 +1740,10 @@ CTDL_MODULE_INIT(imap) if (!threading) { CtdlRegisterDebugFlagHook(HKEY("imapsrv"), SetIMAPDebugEnabled, &IMAPDebugEnabled); - CtdlRegisterServiceHook(config.c_imap_port, + CtdlRegisterServiceHook(CtdlGetConfigInt("c_imap_port"), NULL, imap_greeting, imap_command_loop, NULL, CitadelServiceIMAP); #ifdef HAVE_OPENSSL - CtdlRegisterServiceHook(config.c_imaps_port, + CtdlRegisterServiceHook(CtdlGetConfigInt("c_imaps_port"), NULL, imaps_greeting, imap_command_loop, NULL, CitadelServiceIMAPS); #endif CtdlRegisterSessionHook(imap_cleanup_function, EVT_STOP, PRIO_STOP + 30); diff --git a/citadel/modules/instmsg/serv_instmsg.c b/citadel/modules/instmsg/serv_instmsg.c index 2c28600b6..988478537 100644 --- a/citadel/modules/instmsg/serv_instmsg.c +++ b/citadel/modules/instmsg/serv_instmsg.c @@ -1,7 +1,7 @@ /* * This module handles instant messaging between users. * - * Copyright (c) 1987-2012 by the citadel.org team + * Copyright (c) 1987-2015 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3. @@ -11,6 +11,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ + #include "sysdep.h" #include #include @@ -174,7 +175,7 @@ void cmd_gexp(char *argbuf) { (long)ptr->timestamp, /* time sent */ ptr->flags, /* flags */ ptr->sender, /* sender of msg */ - config.c_nodename, /* static for now (and possibly deprecated) */ + CtdlGetConfigStr("c_nodename"), /* static for now (and possibly deprecated) */ ptr->sender_email /* email or jid of sender */ ); @@ -478,7 +479,7 @@ void flush_individual_conversation(struct imlog *im) { } CM_SetField(msg, eOriginalRoom, HKEY(PAGELOGROOM)); - CM_SetField(msg, eNodeName, CFG_KEY(c_nodename)); + CM_SetField(msg, eNodeName, CtdlGetConfigStr("c_nodename"), strlen(CtdlGetConfigStr("c_nodename"))); CM_SetAsFieldSB(msg, eMesageText, &FullMsgBuf); /* we own this memory now */ /* Start with usernums[1] because it's guaranteed to be higher than usernums[0], @@ -503,9 +504,9 @@ void flush_individual_conversation(struct imlog *im) { } /* Finally, if we're logging instant messages globally, do that now. */ - if (!IsEmptyStr(config.c_logpages)) { - CtdlCreateRoom(config.c_logpages, 3, "", 0, 1, 1, VIEW_BBS); - CtdlSaveMsgPointerInRoom(config.c_logpages, msgnum, 0, NULL); + if (!IsEmptyStr(CtdlGetConfigStr("c_logpages"))) { + CtdlCreateRoom(CtdlGetConfigStr("c_logpages"), 3, "", 0, 1, 1, VIEW_BBS); + CtdlSaveMsgPointerInRoom(CtdlGetConfigStr("c_logpages"), msgnum, 0, NULL); } } diff --git a/citadel/modules/managesieve/serv_managesieve.c b/citadel/modules/managesieve/serv_managesieve.c index 23f5f263c..6bfe11264 100644 --- a/citadel/modules/managesieve/serv_managesieve.c +++ b/citadel/modules/managesieve/serv_managesieve.c @@ -6,7 +6,7 @@ * as this draft expires with this writing, you might need to search for * the new one. * - * Copyright (c) 2007-2012 by the citadel.org team + * Copyright (c) 2007-2015 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3. @@ -651,7 +651,7 @@ CTDL_MODULE_INIT(managesieve) { if (!threading) { - CtdlRegisterServiceHook(config.c_managesieve_port, + CtdlRegisterServiceHook(CtdlGetConfigInt("c_managesieve_port"), NULL, managesieve_greeting, managesieve_command_loop, -- 2.30.2