// frame constructor
EnterMessage::EnterMessage(
- CitClient *sock, wxMDIParentFrame *MyMDI, wxString roomname)
+ CitClient *sock, wxMDIParentFrame *MyMDI,
+ wxString roomname, unsigned int roomflags)
: wxMDIChildFrame(MyMDI, //parent
-1, //window id
roomname + ": enter message",
+
+ // If the user has a choice of several posting names, present them.
+
wxStaticText *fromlabel = new wxStaticText(this, -1, "From: ");
wxLayoutConstraints *c6 = new wxLayoutConstraints;
c6->height.AsIs();
fromlabel->SetConstraints(c6);
- wxString posting_name_choices[] = {
- citsock->curr_user
- };
+ wxString posting_name_choices[2];
+ int num_choices;
+
+ if (roomflags & QR_ANONONLY) {
+ posting_name_choices[0] = "****";
+ num_choices = 1;
+ } else {
+ posting_name_choices[0] = citsock->curr_user;
+ num_choices = 1;
+ }
+
+ if (roomflags & QR_ANONOPT) {
+ posting_name_choices[num_choices++] = "Anonymous";
+ }
+
fromname = new wxChoice(this, -1,
- wxDefaultPosition, wxSize(150,25), 1, posting_name_choices);
+ wxDefaultPosition, wxSize(150,25),
+ num_choices, posting_name_choices);
wxLayoutConstraints *c7 = new wxLayoutConstraints;
c7->centreY.SameAs(fromlabel, wxCentreY);
c7->height.AsIs();
fromname->SetConstraints(c7);
+
+
+ // There may also be the opportunity to present a recipient.
+ // FIX ... disable this if we're not in a mail room
+
wxStaticText *tolabel = new wxStaticText(this, -1, "To: ");
wxLayoutConstraints *c8 = new wxLayoutConstraints;
+
+ // The main portion of this screen is a text entry box.
+
TheMessage = new wxTextCtrl(this, -1, "",
wxDefaultPosition, wxDefaultSize,
wxTE_MULTILINE);
d9->right.SameAs(this, wxRight, 2);
TheMessage->SetConstraints(d9);
+
+
SetAutoLayout(TRUE);
Show(TRUE);
Layout();
#define DEFAULT_HOST "uncnsrd.mt-kisco.ny.us"
#define DEFAULT_PORT "504"
+
+// Room flags (from ipcdef.h in the main Citadel distribution)
+
+#define QR_PERMANENT 1 /* Room does not purge */
+#define QR_INUSE 2 /* Set if in use, clear if avail */
+#define QR_PRIVATE 4 /* Set for any type of private room */
+#define QR_PASSWORDED 8 /* Set if there's a password too */
+#define QR_GUESSNAME 16 /* Set if it's a guessname room */
+#define QR_DIRECTORY 32 /* Directory room */
+#define QR_UPLOAD 64 /* Allowed to upload */
+#define QR_DOWNLOAD 128 /* Allowed to download */
+#define QR_VISDIR 256 /* Visible directory */
+#define QR_ANONONLY 512 /* Anonymous-Only room */
+#define QR_ANONOPT 1024 /* Anonymous-Option room */
+#define QR_NETWORK 2048 /* Shared network room */
+#define QR_PREFONLY 4096 /* Preferred status needed to enter */
+#define QR_READONLY 8192 /* Aide status required to post */
+#define QR_MAILBOX 16384 /* Set if this is a private mailbox */
+
+
+
+
// TCPsocket represents a socket-level TCP connection to a server.
class TCPsocket {
public:
class EnterMessage : public wxMDIChildFrame {
public:
EnterMessage(CitClient *sock, wxMDIParentFrame *MyMDI,
- wxString roomname);
+ wxString roomname, unsigned int roomflags);
private:
void OnCancel(wxCommandEvent& whichbutton);
void OnSave(wxCommandEvent& whichbutton);
extract(ThisRoom, recvcmd.Mid(4), 0); // actual name of room
new_messages = extract_int(recvcmd.Mid(4), 1);
total_messages = extract_int(recvcmd.Mid(4), 2);
+ RoomFlags = extract_int(recvcmd.Mid(4), 4);
is_roomaide = (extract_int(recvcmd.Mid(4), 8) ? TRUE : FALSE);
SetTitle(ThisRoom); // FIX why doesn't this work?
} else if (whichbutton.GetId() == BUTTON_READALL) {
do_readloop("MSGS ALL");
} else if (whichbutton.GetId() == BUTTON_ENTER) {
- new EnterMessage(citsock, citMyMDI, ThisRoom);
+ new EnterMessage(citsock, citMyMDI, ThisRoom, RoomFlags);
} else if (whichbutton.GetId() == BUTTON_SKIP) {
new RoomView(citsock, citMyMDI, RoomList->GetNextRoom());
delete this;