summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fc34c67)
raw | patch | inline | side by side (parent: fc34c67)
author | dwyip <dwyip@users.sourceforge.net> | |
Fri, 10 Feb 2006 19:13:32 +0000 (19:13 +0000) | ||
committer | dwyip <dwyip@users.sourceforge.net> | |
Fri, 10 Feb 2006 19:13:32 +0000 (19:13 +0000) |
think this should nail it.
diff --git a/src/jabber_whiteboard/connection-establishment.cpp b/src/jabber_whiteboard/connection-establishment.cpp
index 9382227fbb3d23c584f6ca68bac0044e5eb0b8cb..eba75d9a42e278232ae57cecfeb3b9798ea07650 100644 (file)
return;
}
+ if (this->session_data->status[WAITING_FOR_INVITE_RESPONSE]) {
+ // Whoops. Someone tried to invite us while we were inviting someone else
+ // (maybe it was the someone we were trying to invite, maybe it was someone else).
+ //
+ // Our response is to reject the second request, as we can only handle one
+ // invitation at a time. Also, we notify the user (who is waiting for an invitation
+ // response) of the rejection event.
+ this->sendMessage(CONNECT_REQUEST_REFUSED_BY_PEER, 0, "", requesterJID, false);
+
+ Glib::ustring primary = "<span weight=\"bold\" size=\"larger\">";
+
+ // TRANSLATORS: This string is used to inform an Inkboard user that the following
+ // scenario has occurred:
+ // 1. Alice invites Bob to an Inkboard session.
+ // 2. While Alice's invitation is en route, Bob invites Alice to an Inkboard session.
+ //
+ // Or, we might have the following scenario:
+ // 1. Alice invites Bob to an Inkboard session.
+ // 2. While Alice is waiting for Bob's response, Carol sends Alice an invitation.
+ //
+ // In the current implementation, we can only handle one invitation at a time,
+ // so we reject all others.
+ //
+ // This is a fix for bug #1352522. Probably not the friendliest, but it's about
+ // the best we can do without changing the protocol.
+ primary += _("<b>An invitation conflict has occurred.</b>");
+ primary += "</span>\n\n";
+
+ // TRANSLATORS: %1 is the JID of the user who sent us the invitation request.
+ primary += String::ucompose(_("The Jabber user <b>%1</b> attempted to invite you to a whiteboard session while you were waiting on an invitation response.\n\nThe invitation from <b>%1</b> has been rejected."), requesterJID);
+
+ Gtk::MessageDialog dialog(primary, true, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_CLOSE, false);
+ dialog.run();
+ return;
+ }
+
if (this->session_data->status[IN_WHITEBOARD]) {
this->sendMessage(ALREADY_IN_SESSION, 0, "", requesterJID, false);
+ return;
}
// Check to see if the user made any modifications to this document. If so,
diff --git a/src/jabber_whiteboard/message-contexts.cpp b/src/jabber_whiteboard/message-contexts.cpp
index 1b5ea12fdf2cf242867c4a714bca55f7f47aaf80..70983bad0e3d44d71927d86b014234c2a2841b41 100644 (file)
// Message: CONNECT_REQUEST_USER
std::bitset< NUM_FLAGS > m5;
m5.set(LOGGED_IN);
+
+ // We should still _accept_ CONNECT_REQUEST_USER messages even if we're already
+ // waiting for a response. It is up to the higher-level handler (i.e. the connection
+ // request handler) to properly handle it.
+ m5.set(WAITING_FOR_INVITE_RESPONSE);
mcm[CONNECT_REQUEST_USER] = m5;
// Message: CONNECT_REQUEST_RESPONSE_USER
index cdcef74b833f28e302f9cb7d66a008439a4826d9..031ed7348fbf2d6ce37a118565cfc08ae6dc0383 100644 (file)
// TODO: remove this debug block
if ((status & recvcontext).to_ulong() < status.to_ulong()) {
- g_warning("Received message in incorrect context (current is not a subset of required); discarding message.");
+ g_warning("Received message in incorrect context; discarding message.");
std::string s2 = recvcontext.to_string< char, std::char_traits< char >, std::allocator< char > >();
-
g_warning("current context=%s required context=%s (msgtype %s)", s1.c_str(), s2.c_str(), MessageHandler::ink_type_to_string(type));
}