Merge pull request #2041 from profanity-im/some-improvements
All checks were successful
CI / Linux (debian) (pull_request) Successful in 13m45s
CI / Linux (arch) (pull_request) Successful in 16m48s
CI / Linux (fedora) (pull_request) Successful in 15m11s
CI / Check coding style (pull_request) Successful in 29s
CI / Check spelling (pull_request) Successful in 15s
CI / Linux (ubuntu) (pull_request) Successful in 13m50s
CI / Linux (debian) (push) Successful in 11m36s
CI / Linux (arch) (push) Successful in 14m0s
CI / Linux (fedora) (push) Successful in 12m25s
CI / Check coding style (push) Successful in 30s
CI / Check spelling (push) Successful in 16s
CI / Linux (ubuntu) (push) Successful in 11m55s
All checks were successful
CI / Linux (debian) (pull_request) Successful in 13m45s
CI / Linux (arch) (pull_request) Successful in 16m48s
CI / Linux (fedora) (pull_request) Successful in 15m11s
CI / Check coding style (pull_request) Successful in 29s
CI / Check spelling (pull_request) Successful in 15s
CI / Linux (ubuntu) (pull_request) Successful in 13m50s
CI / Linux (debian) (push) Successful in 11m36s
CI / Linux (arch) (push) Successful in 14m0s
CI / Linux (fedora) (push) Successful in 12m25s
CI / Check coding style (push) Successful in 30s
CI / Check spelling (push) Successful in 16s
CI / Linux (ubuntu) (push) Successful in 11m55s
Summary:
- Print the final storage location when successfully decrypting a file with `aesgcm://` source.
- Less GString
- Re-factor cmd_presence()
- Improve const correctness
- Use correct free function. Fixes: 75d7663 ("Free wins summary list")
Pull Request Source: https://github.com/profanity-im/profanity/pull/2041
Author: Steffen Jaeckel <s@jaeckel.eu>
This commit is contained in:
@@ -190,7 +190,7 @@ get_nick_from_full_jid(const char* const full_room_jid)
|
||||
/*
|
||||
* get the fulljid, fall back to the barejid
|
||||
*/
|
||||
char*
|
||||
const char*
|
||||
jid_fulljid_or_barejid(Jid* jid)
|
||||
{
|
||||
if (jid->fulljid) {
|
||||
|
||||
@@ -63,7 +63,7 @@ gboolean jid_is_valid_room_form(Jid* jid);
|
||||
char* create_fulljid(const char* const barejid, const char* const resource);
|
||||
char* get_nick_from_full_jid(const char* const full_room_jid);
|
||||
|
||||
char* jid_fulljid_or_barejid(Jid* jid);
|
||||
const char* jid_fulljid_or_barejid(Jid* jid);
|
||||
gchar* jid_random_resource(void);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -621,7 +621,7 @@ _available_handler(xmpp_stanza_t* const stanza)
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
char* jid = jid_fulljid_or_barejid(xmpp_presence->jid);
|
||||
const char* jid = jid_fulljid_or_barejid(xmpp_presence->jid);
|
||||
log_debug("Presence available handler fired for: %s", jid);
|
||||
}
|
||||
|
||||
@@ -632,7 +632,7 @@ _available_handler(xmpp_stanza_t* const stanza)
|
||||
XMPPCaps* caps = stanza_parse_caps(stanza);
|
||||
if ((g_strcmp0(my_jid->fulljid, xmpp_presence->jid->fulljid) != 0) && caps) {
|
||||
log_debug("Presence contains capabilities.");
|
||||
char* jid = jid_fulljid_or_barejid(xmpp_presence->jid);
|
||||
const char* jid = jid_fulljid_or_barejid(xmpp_presence->jid);
|
||||
_handle_caps(jid, caps);
|
||||
}
|
||||
stanza_free_caps(caps);
|
||||
|
||||
@@ -275,11 +275,8 @@ roster_remove(const char* const name, const char* const barejid)
|
||||
if (contact) {
|
||||
GList* resources = p_contact_get_available_resources(contact);
|
||||
while (resources) {
|
||||
GString* fulljid = g_string_new(barejid);
|
||||
g_string_append(fulljid, "/");
|
||||
g_string_append(fulljid, resources->data);
|
||||
autocomplete_remove(roster->fulljid_ac, fulljid->str);
|
||||
g_string_free(fulljid, TRUE);
|
||||
auto_gchar gchar* fulljid = g_strdup_printf("%s/%s", barejid, (char*)resources->data);
|
||||
autocomplete_remove(roster->fulljid_ac, fulljid);
|
||||
resources = g_list_next(resources);
|
||||
}
|
||||
g_list_free(resources);
|
||||
|
||||
Reference in New Issue
Block a user