Use gboolean consistently.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
This commit is contained in:
@@ -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;
|
||||
@@ -475,7 +475,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;
|
||||
@@ -487,7 +487,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);
|
||||
}
|
||||
|
||||
@@ -853,7 +853,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();
|
||||
@@ -3637,9 +3637,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);
|
||||
}
|
||||
@@ -4187,14 +4187,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;
|
||||
}
|
||||
@@ -9090,12 +9090,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9125,9 +9125,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);
|
||||
}
|
||||
@@ -9510,8 +9510,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);
|
||||
@@ -9621,8 +9621,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);
|
||||
|
||||
@@ -712,7 +712,7 @@ _unique_filename(const char* filename)
|
||||
return unique;
|
||||
}
|
||||
|
||||
static bool
|
||||
static gboolean
|
||||
_has_directory_suffix(const char* path)
|
||||
{
|
||||
return (g_str_has_suffix(path, ".")
|
||||
|
||||
@@ -532,7 +532,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -749,7 +749,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;
|
||||
@@ -952,14 +952,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);
|
||||
@@ -977,7 +977,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 */
|
||||
@@ -994,7 +994,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);
|
||||
}
|
||||
}
|
||||
@@ -1699,7 +1699,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);
|
||||
@@ -1758,7 +1758,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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user