RNCFG: implement missing handler for room aliases.
authorWilfried Goesgens <dothebart@citadel.org>
Sun, 17 Feb 2013 22:32:56 +0000 (23:32 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 17 Feb 2013 22:32:56 +0000 (23:32 +0100)
citadel/modules/network/serv_netspool.c
citadel/netconfig.c

index b0928454c130aafb508bfe08c0141529654316a4..dd049a878445e24f91b3a39c6442d5dae006592b 100644 (file)
@@ -106,12 +106,11 @@ void ParseLastSent(const CfgLineType *ThisOne, StrBuf *Line, const char *LinePos
 
 void ParseRoomAlias(const CfgLineType *ThisOne, StrBuf *Line, const char *LinePos, OneRoomNetCfg *rncfg)
 {
-/*
-       if (rncfg->RNCfg->sender != NULL)
-               continue; / * just one alowed... * /
-       extract_token(nptr->name, buf, 1, '|', sizeof nptr->name);
-       rncfg->RNCfg->sender = nptr;
-*/
+       if (rncfg->Sender != NULL)
+               return;
+
+       ParseGeneric(ThisOne, Line, LinePos, rncfg);
+       rncfg->Sender = NewStrBufDup(rncfg->NetConfigs[roommailalias]->Value[0]);
 }
 
 void ParseSubPendingLine(const CfgLineType *ThisOne, StrBuf *Line, const char *LinePos, OneRoomNetCfg *OneRNCFG)
index d4652e244b6a7be6848114846a3e58a572166a53..a086fea44a92da0cd401b1f9b15a7f97c571223a 100644 (file)
@@ -387,6 +387,7 @@ void FreeRoomNetworkStructContent(OneRoomNetCfg *OneRNCfg)
        FreeStrBuf(&OneRNCfg->Sender);
        FreeStrBuf(&OneRNCfg->RoomInfo);
        FreeStrBuf(&OneRNCfg->misc);
+       memset(OneRNCfg, 0, sizeof(OneRoomNetCfg));
 }
 void vFreeRoomNetworkStruct(void *vOneRoomNetCfg)
 {
@@ -718,7 +719,6 @@ void cmd_snet(char *argbuf)
                RNCfg = CtdlGetNetCfgForRoom(CCC->room.QRnumber);
                if (RNCfg != NULL)
                {
-                       FreeRoomNetworkStructContent(RNCfg);
                        ReadRoomNetConfigFile(&RNCfg, filename);
                }
                else