Incorrect from field for chat started from within a chatroom
Closed this issue · 1 comments
If I use a 3rd party client (Swift on Mac) to join a room - then click on a participant to start a direct chat with them - then the stanza.from
arriving at the chatroom looks like
'test@rooms.blah.im/me@blah.im'
with the name of the room first and the sender second - and the stanza.type
is chat.
The handler for the chat type only looks at the first part and so reports (in this case) - test@rooms.blah.im (i.e. the room) as the sender...
Should it maybe also look at the second part and if the second part (after the slash) contains an @ then use that as the sender ?
I don't know enough of the semantics of the two parts to know if this would be a valid thing to do in all cases ? Any thoughts ? Happy to raise a PR if it makes sense.
On deeper look - it seems the second part can also be the nickname - so no @ - in which case the whole from address should be sent... - maybe if the second part isn't a 36 char UUID then send the whole thing as the sender ?