zk / xmpp-clj

A lightweight clojure wrapper around the smack jabber/XMPP library
41 stars 21 forks source link

Reply with a proper message type #4

Open jetmind opened 11 years ago

jetmind commented 11 years ago

I've tested example bot with Gajim and Psi, and both doesn't display bot's replies to me.

Setting the message type to a chat fixes this.

diff --git src/xmpp_clj/bot.clj src/xmpp_clj/bot.clj
index 8a47b94..2127d95 100644
--- src/xmpp_clj/bot.clj
+++ src/xmpp_clj/bot.clj
@@ -46,6 +46,7 @@
         rep (Message.)]
      (.setTo rep to)
      (.setBody rep (str to-message-body))
+     (.setType rep Message$Type/chat)
      rep)
    (catch Exception e (println e))))

But, I think, generally, we need to set reply message type based on incoming message type. E.g. if my client has sent message with chat type (Message.Type.CHAT) then the bot also should reply with the same message type.

Now bot always replies with a normal message type (Message.Type.NORMAL), which doesn't work with some clients.

vbauer commented 9 years ago

:+1: I have the same problem with Gajim. Any news about this issue?

UPD: @jetmind Thank you very much for your solution, it works!

jetmind commented 9 years ago

@vbauer No problem, I'm glad it still works :)

I think library is not maintained anymore, so you may want to maintain your own fork.

mahnunchik commented 9 years ago

+1