Make muc_nick return a const char* const

In the documentation of the `muc_nick` function we can read:

> The nickname is owned by the chat room and should not be modified or freed

We should reflect that in the return type and `strdup` the value for the
plugin API.

Fixes: https://github.com/profanity-im/profanity/issues/2013
This commit is contained in:
Hanspeter Portner
2025-01-19 13:21:31 +01:00
parent baddf2a8da
commit cb395b7c09
11 changed files with 23 additions and 18 deletions

View File

@@ -426,7 +426,7 @@ muc_rooms(void)
* Return current users nickname for the specified room
* The nickname is owned by the chat room and should not be modified or freed
*/
char*
const char* const
muc_nick(const char* const room)
{
ChatRoom* chat_room = g_hash_table_lookup(rooms, room);