]> code.citadel.org Git - citadel.git/blobdiff - citadel/client_chat.c
* Make stealth mode available to all users
[citadel.git] / citadel / client_chat.c
index 7c4b02c56055ee8e50eaf2c5175c1745cffaf7b1..b5d867fe41753a6b139e1bfc851f93684ea93f46 100644 (file)
@@ -314,3 +314,35 @@ void quiet_mode(void)
                scr_printf("Quiet mode disabled (other users may page you)\n");
        }
 }
+
+
+void stealth_mode(void)
+{
+       int qstate;
+       char buf[SIZ];
+
+       serv_puts("STEL 2");
+       serv_gets(buf);
+       if (buf[0] != '2') {
+               scr_printf("%s\n", &buf[4]);
+               return;
+       }
+       qstate = atoi(&buf[4]);
+       if (qstate == 0)
+               qstate = 1;
+       else
+               qstate = 0;
+       snprintf(buf, sizeof buf, "STEL %d", qstate);
+       serv_puts(buf);
+       serv_gets(buf);
+       if (buf[0] != '2') {
+               scr_printf("%s\n", &buf[4]);
+               return;
+       }
+       qstate = atoi(&buf[4]);
+       if (qstate) {
+               scr_printf("Stealth mode enabled (you are invisible)\n");
+       } else {
+               scr_printf("Stealth mode disabled (you are listed as online)\n");
+       }
+}