Closed nioc closed 1 year ago
New UI for the presence controller with opt-in/out and icons:
@Ppjet6 If I may ask you to take a quick look at this one, that would be very nice of you 😄 I would like to release the 0.9.12 with it.
I have to admit I don't know your framework very much, and don't know this feature really well either.
Because you have an option not to send inactive states, I guess you'll want to replace every <inactive/>
payload with <active/>
when it's disabled.
I tried to run your branch but the stars won't align today and nothing is working. :( I can have another look tomorrow if you want.
When the user click on another room or contact chat, If he opt-in the "send inactive chat state", it will send <inactive xmlns='http://jabber.org/protocol/chatstates'/>
, otherwise it is not sent.
For composing (and paused) states it is when user is typing (and after a delay), only if the user does not opt-out for it.
I hope I didn't break anything. I will attach a release.tar.gz in few hours for testing.
Here the draft release xmpp-web-57-send-chat-states-xep-0085.tar.gz
Also the docker image:
docker pull nioc/xmpp-web:57-send-chat-states-xep-0085
Looks like it's working alright! It's just sending chatstates right? Not reading.
I realized it's not "clearing" the <paused/>
state over the wire? A client may keep displaying it until it receives something else from XMPP Web.
Yes it just do this 😄 If you mean by "reading": displaying chat states, it is already implemented with an icon on the top bar: If you mean read Mark it is another XEP 0333 on #4.
Yes it leaves in paused
until you send or erase (active
) or type again (composing
). It is what I understood from the XEP spec.
Testing with Gajim which removes the state itself after a while without receiving anything from xmpp-web.
Pseudo code :
On input (typing or erasing)
Do nothing and finish if opt-out
remove `pause` timer
If composing message not empty
Prepare timer: in 15s send `paused`
If already sent `composing` do nothing
Send`composing`
Else (cleared draft)
Send `active`
The issue with leaving the <paused/>
state hanging is that some clients don't clear it up themselves. The source of truth being the sending client and not what they think of the sending client. That's also more state to manage for the receiving client when you could just read and display what comes.
As for "reading", I meant displaying what other clients send you. And I don't think you do (and that's ok!)
I agree it is not great, but it would only appears when a user leave unfinished his message without sending or erasing (the paused
status is, in this case, relevant).
Reading the specs make me think that we should not sending other status.
The only workaround would be to send an active
after a longer delay, but I propose releasing as-is and reacting if there are issues.
Opt-out for composing/pauses/active states Opt-in for inactive state Save user preferences to local storage And add icons to presence controller
57