From: daleharvey Date: Mon, 8 May 2006 17:58:44 +0000 (+0000) Subject: Persist User / Server / ChatServer name across succesful sessions (Given By Botty) X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=433f3caa69e083142eee9faa134f92ac461f20de;p=inkscape.git Persist User / Server / ChatServer name across succesful sessions (Given By Botty) --- diff --git a/src/jabber_whiteboard/chat-handler.cpp b/src/jabber_whiteboard/chat-handler.cpp index bdb840066..b3e906508 100644 --- a/src/jabber_whiteboard/chat-handler.cpp +++ b/src/jabber_whiteboard/chat-handler.cpp @@ -137,6 +137,7 @@ ChatMessageHandler::parse(LmMessage* message) this->_sm->session_data->receive_queues[sender.raw()] = new ReceiveMessageQueue(this->_sm); } else { + //g_warning("hmm, who is chatting %s",chatter); // If the presence message is from ourselves, then we know that we // have successfully entered the chatroom _and_ have received the entire room roster, // and can therefore decide whether we need to synchronize with the rest of the room. diff --git a/src/jabber_whiteboard/connection-establishment.cpp b/src/jabber_whiteboard/connection-establishment.cpp index 5cc9e053d..2fb367bed 100644 --- a/src/jabber_whiteboard/connection-establishment.cpp +++ b/src/jabber_whiteboard/connection-establishment.cpp @@ -19,6 +19,8 @@ #include "file.h" #include "document.h" +#include "prefs-utils.h" + #include "xml/repr.h" #include "jabber_whiteboard/defines.h" @@ -90,6 +92,13 @@ SessionManager::sendRequestToChatroom(Glib::ustring const& server, Glib::ustring this->session_data->chat_server = server; this->session_data->chat_name = chatroom; + prefs_set_string_attribute("whiteboard.room", "name", chatroom.c_str()); + prefs_set_string_attribute("whiteboard.room", "server", server.c_str()); + //Commented out because you can use whiteboard.server.username + //prefs_set_string_attribute("whiteboard.room", "handle", handle.c_str()); + //store password here? + + this->setRecipient(String::ucompose("%1@%2", chatroom, server).data()); lm_message_unref(presence_req); diff --git a/src/jabber_whiteboard/session-manager.cpp b/src/jabber_whiteboard/session-manager.cpp index 5a7dda426..9a314842e 100644 --- a/src/jabber_whiteboard/session-manager.cpp +++ b/src/jabber_whiteboard/session-manager.cpp @@ -23,6 +23,8 @@ #include "gc-anchored.h" +#include "prefs-utils.h" + #include "xml/repr.h" #include "xml/node-observer.h" @@ -289,6 +291,14 @@ SessionManager::connectToServer(Glib::ustring const& server, Glib::ustring const this->_setVerbSensitivity(ESTABLISHED_CONNECTION); + //On successful connect, remember info + prefs_set_string_attribute("whiteboard.server", "name", server.c_str()); + prefs_set_string_attribute("whiteboard.server", "port", port.c_str()); + prefs_set_string_attribute("whiteboard.server", "username", username.c_str()); + prefs_set_int_attribute("whiteboard.server", "ssl", (usessl) ? 1 : 0); + //Option to store password here? + + return CONNECT_SUCCESS; } diff --git a/src/preferences-skeleton.h b/src/preferences-skeleton.h index 2fed2b3df..92288cb65 100644 --- a/src/preferences-skeleton.h +++ b/src/preferences-skeleton.h @@ -247,6 +247,10 @@ static char const preferences_skeleton[] = " \n" " \n" " \n" +" \n" +" \n" +" \n" +" \n" "\n" "\n"; diff --git a/src/ui/dialog/whiteboard-connect.cpp b/src/ui/dialog/whiteboard-connect.cpp index 50f44e5f7..cb873b904 100644 --- a/src/ui/dialog/whiteboard-connect.cpp +++ b/src/ui/dialog/whiteboard-connect.cpp @@ -81,7 +81,10 @@ WhiteboardConnectDialogImpl::_construct() this->_labels[2].set_mnemonic_widget(this->_password); this->_labels[3].set_mnemonic_widget(this->_port); - this->_port.set_text("5222"); + this->_server.set_text(prefs_get_string_attribute("whiteboard.server", "name")); + this->_port.set_text(prefs_get_string_attribute("whiteboard.server", "port")); + this->_username.set_text(prefs_get_string_attribute("whiteboard.server", "username")); + this->_usessl.set_active((prefs_get_int_attribute("whiteboard.server", "ssl", 0) == 1) ? true : false); this->_layout.attach(this->_labels[0], 0, 1, 0, 1); this->_layout.attach(this->_labels[3], 2, 3, 0, 1); diff --git a/src/ui/dialog/whiteboard-sharewithchat.cpp b/src/ui/dialog/whiteboard-sharewithchat.cpp index 4c86b0dfa..eed9fa168 100644 --- a/src/ui/dialog/whiteboard-sharewithchat.cpp +++ b/src/ui/dialog/whiteboard-sharewithchat.cpp @@ -20,6 +20,8 @@ #include "inkscape.h" #include "desktop.h" +#include "prefs-utils.h" + #include "jabber_whiteboard/typedefs.h" #include "jabber_whiteboard/session-manager.h" #include "jabber_whiteboard/buddy-list-manager.h" @@ -80,6 +82,11 @@ WhiteboardShareWithChatroomDialogImpl::_construct() this->_labels[2].set_mnemonic_widget(this->_roompass); this->_labels[3].set_mnemonic_widget(this->_handle); + + this->_roomname.set_text(prefs_get_string_attribute("whiteboard.room", "name")); + this->_confserver.set_text(prefs_get_string_attribute("whiteboard.room", "server")); + this->_handle.set_text(prefs_get_string_attribute("whiteboard.server", "username")); + // Pack table this->_layout.attach(this->_labels[0], 0, 1, 0, 1); this->_layout.attach(this->_labels[1], 0, 1, 1, 2);