]> code.citadel.org Git - citadel.git/blobdiff - webcit/who.c
FDIO: make splice runtime optional
[citadel.git] / webcit / who.c
index 692481e382dfec128f8850925dc73c0776dc9e27..9fdd9a90b53838f47377cde67ad00a520bee23eb 100644 (file)
@@ -1,6 +1,3 @@
-/*
- * $Id$
- */
 
 #include "webcit.h"
 
@@ -51,7 +48,10 @@ int GetWholistSection(HashList *List, time_t now, StrBuf *Buf)
        serv_puts("RWHO");
        StrBuf_ServGetln(Buf);
        if (GetServerStatus(Buf, NULL) == 1) {
-               while (BufLen = StrBuf_ServGetln(Buf), strcmp(ChrPtr(Buf), "000")) {
+               while (BufLen = StrBuf_ServGetln(Buf), 
+                      ((BufLen >= 0) && 
+                       ((BufLen != 3) || strcmp(ChrPtr(Buf), "000"))))
+               {
                        if (BufLen <= 0)
                            continue;
                        Pos = NULL;
@@ -160,7 +160,7 @@ void edit_me(void)
                        "To turn off any 'fake' name you've previously "
                        "set, simply click the appropriate 'change' button "
                        "without typing anything in the corresponding box. "));
-               wc_printf("<br />\n");
+               wc_printf("<br>\n");
 
                wc_printf("<form method=\"POST\" action=\"edit_me\">\n");
                wc_printf("<input type=\"hidden\" name=\"nonce\" value=\"%d\">\n", WC->nonce);
@@ -274,6 +274,11 @@ void tmplput_who_realhost(StrBuf *Target, WCTemplputParams *TP)
        UserStateStruct *User = (UserStateStruct*) CTX;
        StrBufAppendTemplate(Target, TP, User->RealHost, 0);
 }
+int conditional_who_realhost(StrBuf *Target, WCTemplputParams *TP)
+{
+       UserStateStruct *User = (UserStateStruct*) CTX;
+       return StrLength(User->RealHost) > 0;
+}
 
 void tmplput_who_lastactive(StrBuf *Target, WCTemplputParams *TP)
 {
@@ -343,4 +348,5 @@ InitModule_WHO
        RegisterConditional(HKEY("WHO:NSESSIONS"), 1, conditional_who_nsessions, CTX_WHO);
        RegisterConditional(HKEY("WHO:ISME"),      1, conditional_who_isme, CTX_WHO);
        RegisterConditional(HKEY("WHO:REALROOM"),  1, conditional_who_realroom, CTX_WHO);
+       RegisterConditional(HKEY("WHO:REALHOST"),  1, conditional_who_realhost, CTX_WHO);
 }