/*
* Lots of different room-related operations.
*
- * Copyright (c) 1996-2011 by the citadel.org team
+ * Copyright (c) 1996-2012 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.
+ * 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.
*
- * 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 "webcit.h"
*/
void delete_room(void)
{
- StrBuf *Line;
+ StrBuf *Line = NewStrBuf();
+ const StrBuf *GoBstr;
- serv_puts("KILL 1");
- StrBuf_ServGetln(Line);
- if (GetServerStatusMsg(Line, NULL, 1, 2) != 2) {
- display_main_menu();
- } else {
- StrBuf *Buf;
-
- FlushRoomlist ();
- Buf = NewStrBufPlain(HKEY("_BASEROOM_"));
- smart_goto(Buf);
- FreeStrBuf(&Buf);
+ GoBstr = sbstr("go");
+
+ if (GoBstr != NULL)
+ {
+ if (gotoroom(GoBstr) == 200)
+ {
+ serv_puts("KILL 1");
+ StrBuf_ServGetln(Line);
+ if (GetServerStatusMsg(Line, NULL, 1, 2) == 2) {
+ StrBuf *Buf;
+
+ FlushRoomlist ();
+ Buf = NewStrBufPlain(HKEY("_BASEROOM_"));
+ smart_goto(Buf);
+ FreeStrBuf(&Buf);
+ FreeStrBuf(&Line);
+ return;
+ }
+ }
}
+ display_main_menu();
FreeStrBuf(&Line);
}
}
-int GetCurrentRoomFlags(folder *Room)
+int GetCurrentRoomFlags(folder *Room, int CareForStatusMessage)
{
StrBuf *Buf;
FlushStrBuf(Room->XAPass);
FlushStrBuf(Room->Directory);
StrBufCutLeft(Buf, 4);
- AppendImportantMessage (SKEY(Buf));
+ if (CareForStatusMessage)
+ AppendImportantMessage (SKEY(Buf));
FreeStrBuf(&Buf);
+ Room->XALoaded = 2;
return 0;
} else {
const char *Pos;
{
wcsession *WCC = WC;
- if (WCC->CurRoom.XALoaded)
+ if (WCC->CurRoom.XALoaded > 0)
return;
- GetCurrentRoomFlags(&WCC->CurRoom);
+ GetCurrentRoomFlags(&WCC->CurRoom, 0);
}
void toggle_self_service(void) {
wcsession *WCC = WC;
- if (GetCurrentRoomFlags (&WCC->CurRoom) == 0)
+ if (GetCurrentRoomFlags (&WCC->CurRoom, 1) == 0)
return;
if (yesbstr("QR2_SelfList"))
http_transmit_thing(ChrPtr(do_template("room_edit")), 0);
return;
}
- if (GetCurrentRoomFlags (&WCC->CurRoom) == 0)
+ if (GetCurrentRoomFlags (&WCC->CurRoom, 1) == 0) {
+ http_transmit_thing(ChrPtr(do_template("room_edit")), 0);
return;
+ }
LoadRoomAide();
wcsession *WCC = WC;
- if (GetCurrentRoomFlags(&WCC->CurRoom) == 1)
+ if (GetCurrentRoomFlags(&WCC->CurRoom, 1) == 1)
{
const char *Pos;
UserNames = sbstr("username");
StrBuf *TmpBuf;
int Done;
+ if (havebstr("force_room")) {
+ gotoroom(sbstr("force_room"));
+ }
/*/ TODO: do line dynamic! */
if (havebstr("line_pop3host")) {
strcpy(line, bstr("prefix"));