/*
* This module handles self-service subscription/unsubscription to mail lists.
*
- * Copyright (c) 2002-2012 by the citadel.org team
+ * Copyright (c) 2002-2016 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 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"
RoomMailAddress = qrbuf.QRname;
OneRNCfg = CtdlGetNetCfgForRoom(qrbuf.QRnumber);
- if (OneRNCfg!=NULL) {
+ if (OneRNCfg != NULL) {
found_sub = CountThisSubscriber(OneRNCfg, *email);
if (StrLength(OneRNCfg->Sender) > 0) {
EmailSender = RoomMailAddress = ChrPtr(OneRNCfg->Sender);
ChrPtr(*email),
RoomMailAddress);
+ FreeRoomNetworkStruct(&OneRNCfg);
end_critical_section(S_NETCONFIGS);
return;
}
"\n"
"--__ctdlmultipart__--\n"), 0);
+ SaveRoomNetConfigFile(OneRNCfg, qrbuf.QRnumber);
+ FreeRoomNetworkStruct(&OneRNCfg);
end_critical_section(S_NETCONFIGS);
pcf_req = SmashStrBuf(&cf_req);
}
if (found_sub == 0) {
- cprintf("%d '%s' is not subscribed to '%s'.\n",
- ERROR + NO_SUCH_USER,
- ChrPtr(*email),
- qrbuf.QRname);
-
+ cprintf("%d '%s' is not subscribed to '%s'.\n", ERROR + NO_SUCH_USER, ChrPtr(*email), qrbuf.QRname);
+ FreeRoomNetworkStruct(&OneRNCfg);
end_critical_section(S_NETCONFIGS);
return;
}
"\n"
"--__ctdlmultipart__--\n"), 0);
+ SaveRoomNetConfigFile(OneRNCfg, qrbuf.QRnumber);
+ FreeRoomNetworkStruct(&OneRNCfg);
end_critical_section(S_NETCONFIGS);
pcf_req = SmashStrBuf(&cf_req);
{
/* whipe duplicate subscribe entry... */
OneRNCfg->changed = 1;
- // SaveChangedConfigs(); FIXME FOOFOO SAVE CONFIG HERE
errmsg = "already subscribed";
}
}
}
DeleteGenericCfgLine(NULL/*TODO*/, &ConfirmLine);
OneRNCfg->changed = 1;
- // SaveChangedConfigs(); FIXME FOOFOO SAVE CONFIG HERE
}
+ SaveRoomNetConfigFile(OneRNCfg, qrbuf.QRnumber);
+ FreeRoomNetworkStruct(&OneRNCfg);
end_critical_section(S_NETCONFIGS);
/*
/*
* Bring external RSS feeds into rooms.
*
- * Copyright (c) 2007-2015 by the citadel.org team
+ * Copyright (c) 2007-2016 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.
void UpdateLastKnownGood(pRSSConfig *pCfg, time_t now)
{
- OneRoomNetCfg* pRNCfg;
+ OneRoomNetCfg *pRNCfg;
begin_critical_section(S_NETCONFIGS);
- pRNCfg = CtdlGetNetCfgForRoom (pCfg->QRnumber);
+ pRNCfg = CtdlGetNetCfgForRoom(pCfg->QRnumber);
if (pRNCfg != NULL)
{
RSSCfgLine *RSSCfg = (RSSCfgLine *)pRNCfg->NetConfigs[rssclient];
}
}
+ SaveRoomNetConfigFile(pRNCfg, pCfg->QRnumber);
+ FreeRoomNetworkStruct(&pRNCfg);
end_critical_section(S_NETCONFIGS);
}
/*
- * Traverse the room file...
+ * Iterate through the room table, performing a callback for each room.
*/
void CtdlForEachRoom(ForEachRoomCallBack CB, void *in_data)
{
}
/*
- * Traverse the room file...
+ * Iterate through the room table, performing a callback for each room that has a netconfig entry.
*/
void CtdlForEachNetCfgRoom(ForEachRoomNetCfgCallBack CB, void *in_data, RoomNetCfg filter)
{
room_sanity_check(&qrbuf);
if (qrbuf.QRflags & QR_INUSE)
{
- OneRoomNetCfg* RNCfg;
+ OneRoomNetCfg *RNCfg;
RNCfg = CtdlGetNetCfgForRoom(qrbuf.QRnumber);
if ((RNCfg != NULL) && ((filter == maxRoomNetCfg) || (RNCfg->NetConfigs[filter] != NULL)))
{
CB(&qrbuf, in_data, RNCfg);
+ FreeRoomNetworkStruct(&RNCfg);
}
- // FIXME free RNCfg
}
}
}