yaxim-org / yaxim

yaxim - a lean XMPP/Jabber client for Android
https://yaxim.org
GNU General Public License v3.0
486 stars 238 forks source link

Handle <gone> error while attempting to join a room #234

Open Zash opened 5 years ago

Zash commented 5 years ago

A possible error when trying to join a room is gone. One could interpret this like that the room has been destroyed, so handling it in a similar manner as a live room destruction (see #233 ) could be sensible.

Currently it a generic error message is show at the top, where the actual error is difficult to see on a narrow screen.

At least Prosody will respond like this when attempting to join a destroyed room for which there exists a tombstone in its place.

C:
<presence to='a@muc.example.com/Alice' id='CSi8x-1540' type='unavailable'></presence>
<presence to='a@muc.example.com/Alice' id='CSi8x-1541'>
  <status/>
  <priority>0</priority>
  <x xmlns='http://jabber.org/protocol/muc'>
    <password/>
    <history maxstanzas='250'/>
  </x>
  <c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.igniterealtime.org/projects/smack' ver='yUzUyrQ+S1qbhHsRIdx/NNHUBtM='/>
</presence>

S:
<presence type='error' from='a@muc.example.com/Alice' id='CSi8x-1541'>
  <error type='cancel'>
    <gone xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>xmpp:b@muc.example.com?join</gone>
    <text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>I grow tired of this place</text>
  </error>
</presence>