diff --git a/include/Swiften/Server/ServerStanzaChannel.cpp b/include/Swiften/Server/ServerStanzaChannel.cpp index d13a0a9b5380832aac84f69ecef041fff5527852..8150d20de6dfac12b85cac30d4943ad8a36b6649 100644 --- a/include/Swiften/Server/ServerStanzaChannel.cpp +++ b/include/Swiften/Server/ServerStanzaChannel.cpp @@ -102,6 +102,10 @@ void ServerStanzaChannel::send(boost::shared_ptr stanza) { JID to = stanza->getTo(); assert(to.isValid()); + if (!stanza->getFrom().isValid()) { + stanza->setFrom(m_jid); + } + // For a full JID, first try to route to a session with the full JID if (!to.isBare()) { std::list >::const_iterator i = std::find_if(sessions[stanza->getTo().toBare().toString()].begin(), sessions[stanza->getTo().toBare().toString()].end(), HasJID(to));