JitsiConferenceError vs JitsiConnectionError

Confusing the diffrence between JitsiConferenceError vs JitsiConnectionError during the state changed from connect/join/joined.

while i’m developing a module:hook to perform additional external checks like OTP for member only conference. Am i correct about the following statement ?

In muc-room-pre-create hook,
if verify_user failed,
session.send(st.error_reply(stanza, “cancel”, “not-allowed”));
then you get a JitsiConnectionError ??

But in muc-occupant-pre-join hook, same
if verify_user failed,
session.send(st.error_reply(stanza, “cancel”, “not-allowed”));
then you get a JitsiConferenceError

So there is a xmpp connection with a random jid and then you have a room and you have a occupant jid which is ‘room_jid/nick’ where nick it the first 8 chars of your connection jid (or something like that).
And if you receive error to the connection jid you get a JitsiConnectionError and if you get an error send to the occupant jid you get a JitsiConferenceError.

In your particular example, returning an error on room-pre-create as there is no room it is normal for the error to be returned to the connection jid, while on the second case there is a room and you are trying to join in it with a nick (occupan_jid) so you get the error there.

Hope that helps.

1 Like

How to send an error to the connection jid in
“muc-occupant-pre-join” hook,
to trigger JitsiConnectionErrors.PASSWORD_REQUIRED ?
so that user get an popup AlertDialog with current client App.

I don’t think you can as you are replying to a stanza that came from the occupant jid.