errbot
errbot copied to clipboard
Divert to private doesn't work in master (36272a7a73)
When I run a command from MUC that should be sent as private message, the message is instead sent to the conference itself.
Received stanza:
<message id="afc5a" from="[email protected]/apophys" xml:lang="en" type="groupchat" to="[email protected]/bota">
<body>!help</body>
<nick xmlns="http://jabber.org/protocol/nick">apophys</nick>
</message>
Stanza sent by Err:
<message type="chat" xml:lang="en" to="[email protected]"><body>Available help:
!help CalcBot: solve me this !
!help ChatRoom: This is a basic implementation of a chatroom
!help DnsUtils: Run common DNS utils: host, dig, nslookup
!help ErrBot: Commands related to the bot administration </body></message>
Server's error response
<message from="[email protected]" xml:lang="en" type="error" to="[email protected]/bota"><body>Available help:
!help CalcBot: solve me this !
!help ChatRoom: This is a basic implementation of a chatroom
!help DnsUtils: Run common DNS utils: host, dig, nslookup
!help ErrBot: Commands related to the bot administration </body><error code="406" type="modify">
<not-acceptable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
<text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">It is not allowed to send private messages to the conference</text>
</error>
</message>
The problem seems to be somewhere deeper, as base backend calls mess.getFrom() in
build_reply without any truncating and this returns bare JID without the nick. All this while in xmpp backend the message "from" attribute is set to full JID of incoming message stanza.
Slightly patched 2.0.0 release (xep_0004 thing) with the same SleekXMPP version doesn't have this problem. And it doesn't seem to be caused by the most recent commits either.
tested it on master / XMPP, it works now.