Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reply with a proper message type #4

Open
jetmind opened this issue Dec 8, 2012 · 3 comments
Open

Reply with a proper message type #4

jetmind opened this issue Dec 8, 2012 · 3 comments

Comments

@jetmind
Copy link

jetmind commented Dec 8, 2012

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
Copy link

vbauer commented Nov 27, 2014

👍 I have the same problem with Gajim. Any news about this issue?

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

@jetmind
Copy link
Author

jetmind commented Nov 27, 2014

@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
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants