diff options
| author | David Yip <yipdw@alumni.rose-hulman.edu> | 2006-05-29 02:54:34 +0000 |
|---|---|---|
| committer | dwyip <dwyip@users.sourceforge.net> | 2006-05-29 02:54:34 +0000 |
| commit | 37403e7f7050dc51aa76d68b1c2a8d1f4c8a51df (patch) | |
| tree | 07ba4df9aa6468a00a392275c0e2785908fda4d4 /src | |
| parent | remove 'Preferences' from dialog title, as discussed on ml (diff) | |
| download | inkscape-37403e7f7050dc51aa76d68b1c2a8d1f4c8a51df.tar.gz inkscape-37403e7f7050dc51aa76d68b1c2a8d1f4c8a51df.zip | |
applied JID patch by Alexander Darovsky
(see https://sourceforge.net/tracker/?func=detail&atid=604306&aid=1495414&group_id=93438)
(bzr r1056)
Diffstat (limited to 'src')
| -rw-r--r-- | src/jabber_whiteboard/session-manager.cpp | 16 | ||||
| -rw-r--r-- | src/jabber_whiteboard/session-manager.h | 4 |
2 files changed, 16 insertions, 4 deletions
diff --git a/src/jabber_whiteboard/session-manager.cpp b/src/jabber_whiteboard/session-manager.cpp index d39108901..9ead6b60b 100644 --- a/src/jabber_whiteboard/session-manager.cpp +++ b/src/jabber_whiteboard/session-manager.cpp @@ -331,13 +331,25 @@ SessionManager::registerWithServer(Glib::ustring const& username, Glib::ustring int SessionManager::connectToServer(Glib::ustring const& server, Glib::ustring const& port, - Glib::ustring const& username, Glib::ustring const& pw, bool usessl) + Glib::ustring const& entered_username, Glib::ustring const& pw, bool usessl) { GError* error = NULL; + Glib::ustring username; + Glib::ustring jid; initializeConnection(server,port,usessl); - this->session_data->jid = username + "@" + server + "/" + RESOURCE_NAME; + Glib::ustring::size_type atPos = entered_username.find('@'); + + if (atPos != Glib::ustring::npos) { + jid += entered_username; + username = entered_username.substr(0, atPos); + } else { + jid += entered_username + "@" + server + "/" + RESOURCE_NAME; + username = entered_username; + } + + this->session_data->jid = jid; if (!lm_connection_authenticate_and_block(this->session_data->connection, username.c_str(), pw.c_str(), RESOURCE_NAME, &error)) { if (error != NULL) { diff --git a/src/jabber_whiteboard/session-manager.h b/src/jabber_whiteboard/session-manager.h index 06a3cd4c5..a273fef4d 100644 --- a/src/jabber_whiteboard/session-manager.h +++ b/src/jabber_whiteboard/session-manager.h @@ -245,14 +245,14 @@ public: * Connect to a Jabber server. * * @param server Jabber server URL - * @param username Jabber username + * @param entered_username Jabber username provided by user (may also be full JID) * @param pw password for Jabber account * @param usessl use SSL for connection * * @return CONNECT_SUCCESS if connection successful; FAILED_TO_CONNECT if connection failed or INVALID_AUTH * if authentication invalid */ - int connectToServer(Glib::ustring const& server, Glib::ustring const& port, Glib::ustring const& username, Glib::ustring const& pw, bool usessl); + int connectToServer(Glib::ustring const& server, Glib::ustring const& port, Glib::ustring const& entered_username, Glib::ustring const& pw, bool usessl); /** * Register with a Jabber server. |
