From: daleharvey Date: Thu, 3 Aug 2006 21:56:19 +0000 (+0000) Subject: empty messages are passed onto all listeners in pedro, gui ignores such messages X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f7979e211c43731f9ad56cb7c3001edbe0e98350;p=inkscape.git empty messages are passed onto all listeners in pedro, gui ignores such messages --- diff --git a/src/jabber_whiteboard/inkboard-document.cpp b/src/jabber_whiteboard/inkboard-document.cpp index c46546ebc..e8baee4c7 100644 --- a/src/jabber_whiteboard/inkboard-document.cpp +++ b/src/jabber_whiteboard/inkboard-document.cpp @@ -83,7 +83,7 @@ InkboardDocument::processInkboardEvent(Message::Wrapper &wrapper, Pedro::Element { if(data->exists(Message::ACCEPT_INVITATION)); { - // TODO : Would be nice to create the desktop here + // TODO : Would be nice to create the desktp sendProtocol(getRecipient(),Message::PROTOCOL, Message::CONNECTED); sendProtocol(getRecipient(),Message::PROTOCOL, Message::DOCUMENT_BEGIN); @@ -109,7 +109,6 @@ InkboardDocument::sendProtocol(const Glib::ustring &destJid, Message::Wrapper &w "<%s />" "" "" - " " ""; if (!_sm->getClient().write(fmt, diff --git a/src/jabber_whiteboard/inkboard-document.h b/src/jabber_whiteboard/inkboard-document.h index 4f0f05e07..fcd3bab6a 100644 --- a/src/jabber_whiteboard/inkboard-document.h +++ b/src/jabber_whiteboard/inkboard-document.h @@ -75,8 +75,9 @@ private: void _initBindings(); - SessionManager *_sm; - State::SessionType _type; + SessionManager *_sm; + SPDocument *_doc; + State::SessionType _type; State::SessionState state; Glib::ustring _session; diff --git a/src/jabber_whiteboard/pedrogui.cpp b/src/jabber_whiteboard/pedrogui.cpp index 64578f9af..3e8ee72a1 100644 --- a/src/jabber_whiteboard/pedrogui.cpp +++ b/src/jabber_whiteboard/pedrogui.cpp @@ -2114,19 +2114,22 @@ bool PedroGui::chatDeleteAll() bool PedroGui::chatMessage(const DOMString &from, const DOMString &data) { - std::vector::iterator iter; - for (iter=chats.begin() ; iter != chats.end() ; iter++) - { - if (from == (*iter)->getJid()) + if(data.size() < 1) + { + std::vector::iterator iter; + for (iter=chats.begin() ; iter != chats.end() ; iter++) { - (*iter)->postMessage(data); - return true; + if (from == (*iter)->getJid()) + { + (*iter)->postMessage(data); + return true; + } } - } - ChatWindow *chat = new ChatWindow(*this, from); - chat->show(); - chats.push_back(chat); - chat->postMessage(data); + ChatWindow *chat = new ChatWindow(*this, from); + chat->show(); + chats.push_back(chat); + chat->postMessage(data); + } return true; } diff --git a/src/jabber_whiteboard/session-manager.cpp b/src/jabber_whiteboard/session-manager.cpp index ef842e339..55b41ac20 100644 --- a/src/jabber_whiteboard/session-manager.cpp +++ b/src/jabber_whiteboard/session-manager.cpp @@ -312,8 +312,8 @@ SessionManager::checkInvitationQueue() Dialog::DialogReply reply = static_cast< Dialog::DialogReply >(dialog.run()); - SPDocument* doc = makeInkboardDocument( - g_quark_from_static_string("xml"), "svg:svg", State::WHITEBOARD_PEER, from); + + SPDocument* doc = makeInkboardDocument(g_quark_from_static_string("xml"), "svg:svg", State::WHITEBOARD_PEER, from); InkboardDocument* inkdoc = dynamic_cast< InkboardDocument* >(doc->rdoc); if(inkdoc == NULL) return true; diff --git a/src/pedro/pedroxmpp.cpp b/src/pedro/pedroxmpp.cpp index 48a4930b4..ccaaea4bd 100644 --- a/src/pedro/pedroxmpp.cpp +++ b/src/pedro/pedroxmpp.cpp @@ -1035,8 +1035,8 @@ bool XmppClient::processMessage(Element *root) DOMString body = root->getTagValue("body"); DOMString thread = root->getTagValue("thread"); //##rfc 3921, para 2.4. ignore if no recognizable info - if (subject.size() < 1 && body.size()<1 && thread.size()<1) - return true; + //if (subject.size() < 1 && thread.size()<1) + // return true; if (type == "groupchat") {