mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-25 05:46:21 +00:00
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:
@@ -307,7 +307,7 @@ void
|
||||
groupchat_log_msg_out(const gchar* const room, const gchar* const msg)
|
||||
{
|
||||
if (prefs_get_boolean(PREF_GRLOG)) {
|
||||
char* mynick = muc_nick(room);
|
||||
const char* const mynick = muc_nick(room);
|
||||
_groupchat_log_chat(connection_get_barejid(), room, mynick, msg);
|
||||
}
|
||||
}
|
||||
@@ -326,7 +326,7 @@ groupchat_log_omemo_msg_out(const gchar* const room, const gchar* const msg)
|
||||
if (prefs_get_boolean(PREF_CHLOG)) {
|
||||
const char* mybarejid = connection_get_barejid();
|
||||
auto_gchar gchar* pref_omemo_log = prefs_get_string(PREF_OMEMO_LOG);
|
||||
char* mynick = muc_nick(room);
|
||||
const char* const mynick = muc_nick(room);
|
||||
|
||||
if (strcmp(pref_omemo_log, "on") == 0) {
|
||||
_groupchat_log_chat(mybarejid, room, mynick, msg);
|
||||
|
||||
Reference in New Issue
Block a user