]> code.citadel.org Git - citadel.git/commitdiff
In the online users list, display partially logged in (username sent but no successfu...
authorArt Cancro <ajc@citadel.org>
Mon, 1 Aug 2022 02:05:18 +0000 (22:05 -0400)
committerArt Cancro <ajc@citadel.org>
Mon, 1 Aug 2022 02:05:18 +0000 (22:05 -0400)
citadel/server/modules/rwho/serv_rwho.c
webcit-ng/static/css/webcit.css
webcit-ng/static/js/view_mail.js

index 557f6042d984dacf08f2fcd5e0f7ec0343476b2d..d0f38ff1785c9a19bb7432b05807644d93322489 100644 (file)
@@ -1,18 +1,10 @@
-/*
- * This module implements server commands related to the display and
- * manipulation of the "Who's online" list.
- *
- * Copyright (c) 1987-2022 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 module implements server commands related to the display and
+// manipulation of the "Who's online" list.
+//
+// Copyright (c) 1987-2022 by the citadel.org team
+//
+// This program is open source software.  Use, duplication, or disclosure
+// is subject to the terms of the GNU General Public License, version 3.
 
 #include "../../sysdep.h"
 #include <stdlib.h>
 #include "../../msgbase.h"
 #include "../../ctdl_module.h"
 
-/* Don't show the names of private rooms unless the viewing
- * user also knows the rooms.
- */
-void GenerateRoomDisplay(char *real_room,
-                       CitContext *viewed,
-                       CitContext *viewer) {
-
+// Don't show the names of private rooms unless the viewing
+// user also knows the rooms.
+void GenerateRoomDisplay(char *real_room, CitContext *viewed, CitContext *viewer) {
        int ra;
 
        strcpy(real_room, viewed->room.QRname);
+
        if (viewed->room.QRflags & QR_MAILBOX) {
                strcpy(real_room, &real_room[11]);
        }
+
        if (viewed->room.QRflags & QR_PRIVATE) {
                CtdlRoomAccess(&viewed->room, &viewer->user, &ra, NULL);
                if ( (ra & UA_KNOWN) == 0) {
@@ -69,10 +59,7 @@ void GenerateRoomDisplay(char *real_room,
 }
 
 
-
-/*
- * display who's online
- */
+// display who's online
 void cmd_rwho(char *argbuf) {
        struct CitContext *nptr;
        int nContexts, i;
@@ -81,13 +68,11 @@ void cmd_rwho(char *argbuf) {
        char room[ROOMNAMELEN];
        char flags[5];
        
-       /* So that we don't keep the context list locked for a long time
-        * we create a copy of it first
-        */
+       // So that we don't keep the context list locked for a long time
+       // we create a copy of it first
        nptr = CtdlGetContextArray(&nContexts) ;
-       if (!nptr)
-       {
-               /* Couldn't malloc so we have to bail but stick to the protocol */
+       if (!nptr) {
+               // Couldn't malloc so we have to bail but stick to the protocol
                cprintf("%d%c \n", LISTING_FOLLOWS, CtdlCheckExpress() );
                cprintf("000\n");
                return;
@@ -126,10 +111,14 @@ void cmd_rwho(char *argbuf) {
                if (((nptr[i].cs_flags&CS_STEALTH)==0) || (aide)) {
 
                        cprintf("%d|%s|%s|%s|%s|%ld|%s|%s|",
-                               nptr[i].cs_pid, nptr[i].curr_user, room,
-                               nptr[i].cs_host, nptr[i].cs_clientname,
+                               nptr[i].cs_pid,
+                               (nptr[i].logged_in ? nptr[i].curr_user : NLI),
+                               room,
+                               nptr[i].cs_host,
+                               nptr[i].cs_clientname,
                                (long)(nptr[i].lastidle),
-                               nptr[i].lastcmdname, flags
+                               nptr[i].lastcmdname,
+                               flags
                        );
 
                        cprintf("|");   // no spoofed user names anymore
@@ -140,23 +129,19 @@ void cmd_rwho(char *argbuf) {
                }
        }
        
-       /* release our copy of the context list */
+       // release our copy of the context list
        free(nptr);
 
-       /* Now it's magic time.  Before we finish, call any EVT_RWHO hooks
-        * so that external paging modules such as serv_icq can add more
-        * content to the Wholist.
-        */
+       // Now it's magic time.  Before we finish, call any EVT_RWHO hooks
+       // so that external paging modules such as serv_icq can add more
+       // content to the Wholist.
        PerformSessionHooks(EVT_RWHO);
        cprintf("000\n");
 }
 
 
-/*
- * enter or exit "stealth mode"
- */
-void cmd_stel(char *cmdbuf)
-{
+// enter or exit "stealth mode"
+void cmd_stel(char *cmdbuf) {
        int requested_mode;
 
        requested_mode = extract_int(cmdbuf,0);
@@ -182,10 +167,9 @@ char *ctdl_module_init_rwho(void) {
        if (!threading) {
                CtdlRegisterProtoHook(cmd_rwho, "RWHO", "Display who is online");
                CtdlRegisterProtoHook(cmd_stel, "STEL", "Enter/exit stealth mode");
-               //CtdlRegisterSessionHook(dead_io_check, EVT_TIMER, PRIO_QUEUE + 50);
 
        }
        
-       /* return our module name for the log */
+       // return our module name for the log
         return "rwho";
 }
index 3741957c53af0d73f769a168215057fb96034ad7..2ce69d2ea84b2d0e850565c01a9e435e23232134 100644 (file)
@@ -207,3 +207,11 @@ blockquote pre {
 .ctdl-reading-pane {           /* message reading/composing pane when in mailbox view */
        overflow: auto;
 }
+
+.ctdl-compose-mail {           /* mail composition window */
+       width: 100%;
+       height: 100%;
+       overflow: auto;
+       border: 5px solid red;
+       background-color: yellow;
+}
index 8522e77a851a45d7b6f11eeb18e94716a6edfb32..0b33829298dce91318f27816677127ad313e8970 100644 (file)
@@ -213,8 +213,19 @@ function render_mailbox_display() {
 
 // Compose a new mail message (called by the Reply button here, or by the dispatcher in views.js)
 function mail_compose(is_quoted, references, msgid) {
-       console.log("mail_compose() called");
-       console.log("is_quoted: " + is_quoted);
-       console.log("references: " + references);
-       console.log("msgid: " + msgid);
+
+       document.getElementById("ctdl-main").innerHTML
+               = "<div id=\"ctdl-compose-mail\" class=\"ctdl-compose-mail\">"
+
+               + "<table border=\"1\" width=\"100%\">"
+               + "<tr><td>is_quoted</td><td>" + is_quoted + "</td></tr>"
+               + "<tr><td>references</td><td>" + references + "</td></tr>"
+               + "<tr><td>msgid</td><td>" + msgid + "</td></tr>"
+               + "<tr><td>from</td><td>" + current_user + "</td></tr>"
+               + "<tr><td>to</td><td></td></tr>"
+               + "<tr><td>subject</td><td></td></tr></table>"
+               + "<div class=\"ctdl-msg-body\" id=\"ctdl-editor-body\" style=\"padding:5px;\" contenteditable=\"true\">"
+               + "</div>"
+       ;
+
 }