adhearsion / blather

XMPP/Jabber Library and DSL for Ruby written on EventMachine and Nokogiri.
adhearsion.com/blather
Other
556 stars 89 forks source link

Default messages to no chat state #177

Closed singpolyma closed 1 year ago

singpolyma commented 2 years ago

Defaulting to active is very unintuitive and results in many blather-based bots always appearing "active" in clients that show this in their UI, even when that is not intended or meaningful. If a developer actually means to have a chat state, they should set it themselves.

bklang commented 1 year ago

I'm not opposed to making this choice more explicit, though I'm curious how it is surprising to end users. If a bot is running, is it not generally active (in the sense that it is "paying attention to the chat" as described in XEP-0085) whenever it is running?

If we do go ahead with this change, I'd like to see a changelog entry since this is a change of the library's default behavior.

singpolyma commented 1 year ago

If you're building a chat bot then sure, but for example we use blather to build gateways to other networks, some of which have no concept of "paying attention" or not (such as SMS users).

bklang commented 1 year ago

Thanks. Two follow up questions then:

  1. Does this chat state setting break your gateway use case? I understand that it doesn't have meaning in the context of SMS, but does it have a negative impact on your Blather clients?
  2. Is it possible to override or disable the default chat state setting using normal means (not via monkeypatching)?
singpolyma commented 1 year ago

It confuses our users when it is present, so that's the negative impact.

It is possible to override yes we can do message.chat_state = nil but we must remember to do this for every message we create (even messages with no body, etc) it feels very unintuitive rather than having it default to empty and adding one if relevant.