SpectrumIM / spectrum2

Spectrum 2 IM transports
https://spectrum.im
409 stars 91 forks source link

When group chat messages are displayed as private #393

Open ars3niy opened 4 years ago

ars3niy commented 4 years ago

If a protocol plugin calls purple_conv_chat_write with who="" (leading into conv_write_im) while the user hasn't entered corresponding conference room, then this code path:

https://github.com/SpectrumIM/spectrum2/blob/8ed55ba95b310d1e9da2c821b2fe2767a2a66f03/libtransport/NetworkPluginServer.cpp#L685

will not be entered because nickname is empty, and the message will end up being displayed as private, as will all subsequent messages in this group chat even with who non-empty.

However, calling purple_conv_chat_write with who="" and PURPLE_MESSAGE_SYSTEM seems to be common practice, so perhaps there needs to be a way to handle such messages without accidentally handling them as private?