Skip to content

Reply with a proper message type #4

Open
@jetmind

Description

@jetmind

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions