diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index b17d0493..74998221 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -131,12 +131,12 @@ static gboolean _cmd_execute(ProfWin* window, const char* const command, const c static gboolean _cmd_execute_default(ProfWin* window, const char* inp); static gboolean _cmd_execute_alias(ProfWin* window, const char* const inp, gboolean* ran); static gboolean -_string_matches_one_of(const char* what, const char* is, bool is_can_be_null, const char* first, ...) __attribute__((sentinel)); +_string_matches_one_of(const char* what, const char* is, gboolean is_can_be_null, const char* first, ...) __attribute__((sentinel)); static gboolean _download_install_plugin(ProfWin* window, gchar* url, gchar* path); static gboolean -_string_matches_one_of(const char* what, const char* is, bool is_can_be_null, const char* first, ...) +_string_matches_one_of(const char* what, const char* is, gboolean is_can_be_null, const char* first, ...) { gboolean ret = FALSE; va_list ap; @@ -478,7 +478,7 @@ cmd_connect(ProfWin* window, const char* const command, gchar** args) // no account password setting, prompt } else { - account->password = ui_ask_password(false); + account->password = ui_ask_password(FALSE); conn_status = cl_ev_connect_account(account); free(account->password); account->password = NULL; @@ -490,7 +490,7 @@ cmd_connect(ProfWin* window, const char* const command, gchar** args) // connect with JID } else { jid = g_utf8_strdown(user, -1); - auto_char char* passwd = ui_ask_password(false); + auto_char char* passwd = ui_ask_password(FALSE); conn_status = cl_ev_connect_jid(jid, passwd, altdomain, port, tls_policy, auth_policy); } @@ -856,7 +856,7 @@ _account_set_theme(char* account_name, char* theme) ProfAccount* account = accounts_get_account(session_get_account_name()); if (account) { if (g_strcmp0(account->name, account_name) == 0) { - theme_load(theme, false); + theme_load(theme, FALSE); ui_load_colours(); if (prefs_get_boolean(PREF_ROSTER)) { ui_show_roster(); @@ -3660,9 +3660,9 @@ cmd_join(ProfWin* window, const char* const command, gchar** args) if (!muc_active(room)) { presence_join_room(room, nick, passwd); muc_join(room, nick, passwd, FALSE); - iq_room_affiliation_list(room, "member", false); - iq_room_affiliation_list(room, "admin", false); - iq_room_affiliation_list(room, "owner", false); + iq_room_affiliation_list(room, "member", FALSE); + iq_room_affiliation_list(room, "admin", FALSE); + iq_room_affiliation_list(room, "owner", FALSE); } else if (muc_roster_complete(room)) { ui_switch_to_room(room); } @@ -4210,14 +4210,14 @@ cmd_affiliation(ProfWin* window, const char* const command, gchar** args) if (g_strcmp0(cmd, "list") == 0) { if (!affiliation) { - iq_room_affiliation_list(mucwin->roomjid, "owner", true); - iq_room_affiliation_list(mucwin->roomjid, "admin", true); - iq_room_affiliation_list(mucwin->roomjid, "member", true); - iq_room_affiliation_list(mucwin->roomjid, "outcast", true); + iq_room_affiliation_list(mucwin->roomjid, "owner", TRUE); + iq_room_affiliation_list(mucwin->roomjid, "admin", TRUE); + iq_room_affiliation_list(mucwin->roomjid, "member", TRUE); + iq_room_affiliation_list(mucwin->roomjid, "outcast", TRUE); } else if (g_strcmp0(affiliation, "none") == 0) { win_println(window, THEME_DEFAULT, "!", "Cannot list users with no affiliation."); } else { - iq_room_affiliation_list(mucwin->roomjid, affiliation, true); + iq_room_affiliation_list(mucwin->roomjid, affiliation, TRUE); } return TRUE; } @@ -9148,12 +9148,12 @@ cmd_color(ProfWin* window, const char* const command, gchar** args) auto_gchar gchar* theme = prefs_get_string(PREF_THEME); if (theme) { - gboolean res = theme_load(theme, false); + gboolean res = theme_load(theme, FALSE); if (res) { cons_show("Theme reloaded: %s", theme); } else { - theme_load("default", false); + theme_load("default", FALSE); } } @@ -9183,9 +9183,9 @@ cmd_avatar(ProfWin* window, const char* const command, gchar** args) cons_show("Profanity has not been built with GDK Pixbuf support enabled which is needed to scale the avatar when uploading."); #endif } else if (g_strcmp0(args[0], "get") == 0) { - avatar_get_by_nick(args[1], false); + avatar_get_by_nick(args[1], FALSE); } else if (g_strcmp0(args[0], "open") == 0) { - avatar_get_by_nick(args[1], true); + avatar_get_by_nick(args[1], TRUE); } else { cons_bad_cmd_usage(command); } @@ -9580,8 +9580,8 @@ cmd_change_password(ProfWin* window, const char* const command, gchar** args) return TRUE; } - auto_char char* passwd = ui_ask_password(false); - auto_char char* confirm_passwd = ui_ask_password(true); + auto_char char* passwd = ui_ask_password(FALSE); + auto_char char* confirm_passwd = ui_ask_password(TRUE); if (g_strcmp0(passwd, confirm_passwd) == 0) { iq_register_change_password(connection_get_user(), passwd); @@ -9688,8 +9688,8 @@ cmd_register(ProfWin* window, const char* const command, gchar** args) char* username = args[0]; char* server = args[1]; - auto_char char* passwd = ui_ask_password(false); - auto_char char* confirm_passwd = ui_ask_password(true); + auto_char char* passwd = ui_ask_password(FALSE); + auto_char char* confirm_passwd = ui_ask_password(TRUE); if (g_strcmp0(passwd, confirm_passwd) == 0) { log_info("Attempting to register account %s on server %s.", username, server); diff --git a/src/common.c b/src/common.c index 50727e13..04c55c88 100644 --- a/src/common.c +++ b/src/common.c @@ -738,7 +738,7 @@ _unique_filename(const char* filename) return unique; } -static bool +static gboolean _has_directory_suffix(const char* path) { return (g_str_has_suffix(path, ".") diff --git a/src/config/theme.c b/src/config/theme.c index 5081b49d..74537671 100644 --- a/src/config/theme.c +++ b/src/config/theme.c @@ -533,7 +533,7 @@ _theme_find(const char* const theme_name) g_string_append(path, "/"); g_string_append(path, theme_name); if (!g_file_test(path->str, G_FILE_TEST_EXISTS)) { - g_string_free(path, true); + g_string_free(path, TRUE); path = NULL; } } diff --git a/src/omemo/crypto.c b/src/omemo/crypto.c index 8653b1d1..f63f340a 100644 --- a/src/omemo/crypto.c +++ b/src/omemo/crypto.c @@ -389,7 +389,7 @@ out: gcry_error_t aes256gcm_crypt_file(FILE* in, FILE* out, off_t file_size, - unsigned char key[], unsigned char nonce[], bool encrypt) + unsigned char key[], unsigned char nonce[], gboolean encrypt) { if (!gcry_control(GCRYCTL_INITIALIZATION_FINISHED_P)) { diff --git a/src/omemo/crypto.h b/src/omemo/crypto.h index d3f775dd..4d510998 100644 --- a/src/omemo/crypto.h +++ b/src/omemo/crypto.h @@ -185,7 +185,7 @@ int aes128gcm_decrypt(unsigned char* plaintext, const unsigned char* const key, const unsigned char* const tag); gcry_error_t aes256gcm_crypt_file(FILE* in, FILE* out, off_t file_size, - unsigned char key[], unsigned char nonce[], bool encrypt); + unsigned char key[], unsigned char nonce[], gboolean encrypt); char* aes256gcm_create_secure_fragment(unsigned char* key, unsigned char* nonce); diff --git a/src/omemo/omemo.c b/src/omemo/omemo.c index d66b41c1..f2c06832 100644 --- a/src/omemo/omemo.c +++ b/src/omemo/omemo.c @@ -767,7 +767,7 @@ omemo_on_message_send(ProfWin* win, const char* const message, gboolean request_ GList* device_ids_iter; - omemo_ctx.identity_key_store.recv = false; + omemo_ctx.identity_key_store.recv = FALSE; // Encrypt keys for the recipients GList* recipients_iter; @@ -971,14 +971,14 @@ omemo_on_message_recv(const char* const from_jid, uint32_t sid, ec_public_key* their_identity_key; signal_buffer* identity_buffer = NULL; - omemo_ctx.identity_key_store.recv = true; + omemo_ctx.identity_key_store.recv = TRUE; pre_key_signal_message_deserialize(&message, key->data, key->length, omemo_ctx.signal); their_identity_key = pre_key_signal_message_get_identity_key(message); res = session_cipher_decrypt_pre_key_signal_message(cipher, message, NULL, &plaintext_key); - omemo_ctx.identity_key_store.recv = false; + omemo_ctx.identity_key_store.recv = FALSE; /* Perform a real check of the identity */ ec_public_key_serialize(&identity_buffer, their_identity_key); @@ -996,7 +996,7 @@ omemo_on_message_recv(const char* const from_jid, uint32_t sid, SIGNAL_UNREF(new_pre_key); SIGNAL_UNREF(message); SIGNAL_UNREF(ec_pair); - omemo_bundle_publish(true); + omemo_bundle_publish(TRUE); if (res == 0) { /* Start a new session */ @@ -1013,7 +1013,7 @@ omemo_on_message_recv(const char* const from_jid, uint32_t sid, log_error("[OMEMO][RECV] cannot deserialize message"); } else { res = session_cipher_decrypt_signal_message(cipher, message, NULL, &plaintext_key); - *trusted = true; + *trusted = TRUE; SIGNAL_UNREF(message); } } @@ -1726,7 +1726,7 @@ omemo_encrypt_file(FILE* in, FILE* out, off_t file_size, int* gcry_res) gcry_create_nonce(nonce, OMEMO_AESGCM_NONCE_LENGTH); char* fragment = aes256gcm_create_secure_fragment(key, nonce); - *gcry_res = aes256gcm_crypt_file(in, out, file_size, key, nonce, true); + *gcry_res = aes256gcm_crypt_file(in, out, file_size, key, nonce, TRUE); if (*gcry_res != GPG_ERR_NO_ERROR) { gcry_free(fragment); @@ -1785,7 +1785,7 @@ omemo_decrypt_file(FILE* in, FILE* out, off_t file_size, const char* fragment) key, OMEMO_AESGCM_KEY_LENGTH); gcry_error_t crypt_res; - crypt_res = aes256gcm_crypt_file(in, out, file_size, key, nonce, false); + crypt_res = aes256gcm_crypt_file(in, out, file_size, key, nonce, FALSE); gcry_free(key); diff --git a/src/omemo/store.h b/src/omemo/store.h index b6a9a74d..742ac2aa 100644 --- a/src/omemo/store.h +++ b/src/omemo/store.h @@ -50,7 +50,7 @@ typedef struct signal_buffer* private; uint32_t registration_id; GHashTable* trusted; - bool recv; + gboolean recv; } identity_key_store_t; GHashTable* session_store_new(void); diff --git a/src/ui/core.c b/src/ui/core.c index be77756c..f46addc0 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -361,7 +361,7 @@ void ui_handle_login_account_success(ProfAccount* account, gboolean secured) { if (account->theme) { - if (theme_load(account->theme, false)) { + if (theme_load(account->theme, FALSE)) { ui_load_colours(); if (prefs_get_boolean(PREF_ROSTER)) { ui_show_roster();