Detect screen dimensions _before_ attaching to the server.
[citadel.git] / webcit / messages.c
index 93107db0c5b074410bf2660f2e4a8afcadab3a51..5ae3eb0d491601d2e4d5c6c51e01a534e715c41e 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "webcit.h"
 #include "webserver.h"
-#include "groupdav.h"
+#include "dav.h"
 #include "calendar.h"
 
 HashList *MsgHeaderHandler = NULL;
@@ -1010,7 +1010,7 @@ void post_message(void)
                int saving_to_drafts = 0;
                long HeaderLen = 0;
 
-               saving_to_drafts = !strcasecmp(bstr("submit_action"), "drafts");
+               saving_to_drafts = !strcasecmp(bstr("submit_action"), "draft");
                Buf = NewStrBuf();
 
                if (saving_to_drafts) {
@@ -1113,7 +1113,7 @@ void post_message(void)
                                if (saving_to_drafts) {
                                        AppendImportantMessage(_("Message has been saved to Drafts.\n"), -1);
                                        gotoroom(WCC->CurRoom.name);
-                                       display_enter();
+                                       readloop(readnew, eUseDefault);
                                        FreeStrBuf(&Buf);
                                        return;
                                } else if (  (havebstr("recp"))
@@ -1307,7 +1307,6 @@ void display_enter(void)
        const StrBuf *display_name = NULL;
        int recipient_required = 0;
        int subject_required = 0;
-       int recipient_bad = 0;
        int is_anonymous = 0;
        wcsession *WCC = WC;
        int i = 0;
@@ -1323,7 +1322,9 @@ void display_enter(void)
                is_anonymous = 1;
        }
 
-       /* First test to see whether this is a room that requires recipients to be entered */
+       /*
+        * First, do we have permission to enter messages in this room at all?
+        */
        Line = NewStrBuf();
        serv_puts("ENT0 0");
        StrBuf_ServGetln(Line);
@@ -1595,20 +1596,14 @@ void display_enter(void)
                rc = GetServerStatusMsg(CmdBuf, &Result, 0, 0);
 
                if (    (Result == 570)         /* invalid or missing recipient(s) */
-                       || (Result == 550)      /* access control problem */
+                       || (Result == 550)      /* higher access required to send Internet mail */
                ) {
-                       if (    havebstr("recp")
-                               && havebstr("cc")
-                               && havebstr("bcc")
-                       ) {
-                               recipient_bad = 1;      /* FIXME ... do something with this? */
-                       }
+                       /* These errors will have been displayed and are excusable */
                }
                else if (rc != 2) {     /* Any other error means that we cannot continue */
-
-                       /* FIXME IMMEDIATELY this code results in a blank screen!!! */
-                       wc_printf("<em>%s</em><br>\n", ChrPtr(CmdBuf) +4);
+                       AppendImportantMessage(ChrPtr(CmdBuf) + 4, StrLength(CmdBuf) - 4);
                        FreeStrBuf(&CmdBuf);
+                       readloop(readnew, eUseDefault);
                        return;
                }
                FreeStrBuf(&CmdBuf);