]> code.citadel.org Git - citadel.git/commitdiff
oof
authorArt Cancro <ajc@citadel.org>
Fri, 2 Apr 1999 02:28:51 +0000 (02:28 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 2 Apr 1999 02:28:51 +0000 (02:28 +0000)
daphne/includes.hpp
daphne/roomview.cpp

index 78972a217187d8fa29317719e7d346d8ee1bc78f..ca87778217d8946c2c5e4acc452c765fa28c2a8d 100644 (file)
@@ -226,6 +226,7 @@ private:
        wxTextCtrl *message_window;
         wxPanel *banner;
         wxButton *close_button;
+       wxString ThisRoom;
 };
 
 
index b5cda7905b0c5c89f32b338932a7a4b9bd673c7f..081c9099a7568c8cec5b76dab3d79b9d8b574112 100644 (file)
@@ -35,6 +35,7 @@ RoomView::RoomView(
                delete this;
        }
 
+       extract(ThisRoom, recvcmd.Mid(4), 0);   // actual name of room
 
        SetAutoLayout(TRUE);
        Show(TRUE);
@@ -85,8 +86,6 @@ RoomView::RoomView(
        c2->width.AsIs();
        c2->right.LeftOf(close_button, 5);
        readnew_button->SetConstraints(c2);
-
-
 }
 
 
@@ -105,6 +104,7 @@ void RoomView::OnButtonPressed(wxCommandEvent& whichbutton) {
 void RoomView::do_readloop(wxString readcmd) {
        wxString sendcmd, recvcmd, buf;
        wxStringList xferbuf;
+        int i;
        
        if (message_window != NULL) {
                delete message_window;
@@ -126,12 +126,35 @@ void RoomView::do_readloop(wxString readcmd) {
        m1->right.SameAs(this, wxRight, 2);
        message_window->SetConstraints(m1);
 
+
+       // Transmit the "read messages" command
        sendcmd = readcmd;
-       if (citsock->serv_trans(sendcmd, recvcmd, xferbuf) != 1) {
-               message_window->SetValue(recvcmd.Mid(4));
+       if (citsock->serv_trans(sendcmd, recvcmd, xferbuf, ThisRoom) != 1) {
+               wxMessageDialog cantread(this,
+                       recvcmd.Mid(4),
+                       "Error",
+                       wxOK | wxCENTRE | wxICON_INFORMATION,
+                       wxDefaultPosition);
+               cantread.ShowModal();
                return;
        }
 
-       ListToMultiline(buf, xferbuf);
+
+       // Read the messages into the window, one at a time
        message_window->SetValue(buf);
+        for (i=0; i<xferbuf.Number(); ++i) {
+                buf.Printf("%s", (wxString *)xferbuf.Nth(i)->GetData());
+               sendcmd = "MSG0 " + buf;
+               cout << "Sending cmd: <" << sendcmd << ">\n";
+               i = citsock->serv_trans(sendcmd, recvcmd, xferbuf, ThisRoom);
+               cout << "return code " << i << "\n";
+               if (i == 1) {
+                       ListToMultiline(buf, xferbuf);
+                       message_window->WriteText(buf);
+                       message_window->WriteText("\n\n");
+               }
+               cout << "done outputttting\n";
+        }
 }
+
+