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:
@@ -114,7 +114,7 @@ sv_ev_login_account_success(char* account_name, gboolean secured)
|
||||
GList* curr = rooms;
|
||||
while (curr) {
|
||||
char* password = muc_password(curr->data);
|
||||
char* nick = muc_nick(curr->data);
|
||||
const char* const nick = muc_nick(curr->data);
|
||||
presence_join_room(curr->data, nick, password);
|
||||
curr = g_list_next(curr);
|
||||
}
|
||||
@@ -336,7 +336,7 @@ sv_ev_room_message(ProfMessage* message)
|
||||
return;
|
||||
}
|
||||
|
||||
char* mynick = muc_nick(mucwin->roomjid);
|
||||
const char* const mynick = muc_nick(mucwin->roomjid);
|
||||
|
||||
// only log message not coming from this client (but maybe same account, different client)
|
||||
// our messages are logged when outgoing
|
||||
|
||||
Reference in New Issue
Block a user