Format code correctly

This commit is contained in:
Michael Vetter
2021-10-05 10:01:27 +02:00
parent 7e8cf4a3d6
commit f21595597f
28 changed files with 97 additions and 97 deletions

View File

@@ -89,7 +89,7 @@ chatwin_new(const char* const barejid)
#endif // HAVE_LIBOTR
if (omemo_automatic_start(barejid) && is_otr_secure) {
win_println(window, THEME_DEFAULT, "!", "This chat could be either OMEMO or OTR encrypted, but not both. "
"Use '/omemo start' or '/otr start' to select the encryption method.");
"Use '/omemo start' or '/otr start' to select the encryption method.");
} else if (omemo_automatic_start(barejid)) {
// Start the OMEMO session
omemo_start_session(barejid);
@@ -519,7 +519,7 @@ _chatwin_history(ProfChatWin* chatwin, const char* const contact_barejid)
while (curr) {
ProfMessage* msg = curr->data;
char *msg_plain = msg->plain;
char* msg_plain = msg->plain;
msg->plain = plugins_pre_chat_message_display(msg->from_jid->barejid, msg->from_jid->resourcepart, msg->plain);
// This is dirty workaround for memory leak. We reassign msg->plain above so have to free previous object
// TODO: Make a better solution, for example, pass msg object to the function and it will replace msg->plain properly if needed.

View File

@@ -507,7 +507,8 @@ cons_show_wins(gboolean unread)
}
void
cons_show_wins_attention() {
cons_show_wins_attention()
{
ProfWin* console = wins_get_console();
cons_show("");
GSList* window_strings = wins_create_summary_attention();
@@ -837,12 +838,14 @@ cons_show_disco_items(GSList* items, const char* const jid)
cons_alert(NULL);
}
static void _cons_print_contact_information_item(gpointer data, gpointer user_data)
static void
_cons_print_contact_information_item(gpointer data, gpointer user_data)
{
cons_show(" %s", (char*)data);
}
static void _cons_print_contact_information_hashlist_item(gpointer key, gpointer value, gpointer userdata)
static void
_cons_print_contact_information_hashlist_item(gpointer key, gpointer value, gpointer userdata)
{
cons_show(" %s:", (char*)key);
g_slist_foreach((GSList*)value, _cons_print_contact_information_item, NULL);

View File

@@ -1009,7 +1009,6 @@ ui_win_has_attention(int index)
return ret;
}
char*
ui_ask_password(gboolean confirm)
{

View File

@@ -811,9 +811,10 @@ _inp_rl_win_next_unread_handler(int count, int key)
}
static int
_inp_rl_win_attention_handler(int count, int key) {
_inp_rl_win_attention_handler(int count, int key)
{
ProfWin* current = wins_get_current();
if ( current ) {
if (current) {
gboolean attention = win_toggle_attention(current);
if (attention) {
win_println(current, THEME_DEFAULT, "!", "Attention flag has been activated");
@@ -826,7 +827,8 @@ _inp_rl_win_attention_handler(int count, int key) {
}
static int
_inp_rl_win_attention_next_handler(int count, int key) {
_inp_rl_win_attention_next_handler(int count, int key)
{
ProfWin* window = wins_get_next_attention();
if (window) {
ui_focus_win(window);
@@ -834,7 +836,6 @@ _inp_rl_win_attention_next_handler(int count, int key) {
return 0;
}
static int
_inp_rl_win_pageup_handler(int count, int key)
{

View File

@@ -391,7 +391,7 @@ _mucwin_print_mention(ProfWin* window, const char* const message, const char* co
while (curr) {
pos = GPOINTER_TO_INT(curr->data);
char *before_str = g_utf8_substring(message, last_pos, pos);
char* before_str = g_utf8_substring(message, last_pos, pos);
if (last_pos == 0 && strncmp(before_str, "/me ", 4) == 0) {
win_print_them(window, THEME_ROOMMENTION, ch, flags, "");

View File

@@ -77,7 +77,7 @@ notifier_uninit(void)
void
notify_typing(const char* const name)
{
gchar *message = g_strdup_printf("%s: typing...", name);
gchar* message = g_strdup_printf("%s: typing...", name);
notify(message, 10000, "Incoming message");
g_free(message);
}

View File

@@ -76,7 +76,7 @@ int ui_close_read_wins(void);
void ui_close_win(int index);
int ui_win_unread(int index);
gboolean ui_win_has_attention(int index);
gboolean win_has_attention(ProfWin* window);
gboolean win_has_attention(ProfWin* window);
gboolean win_toggle_attention(ProfWin* window);
char* ui_ask_password(gboolean confirm);
char* ui_get_line(void);

View File

@@ -1843,7 +1843,7 @@ win_unread(ProfWin* window)
}
gboolean
win_has_attention(ProfWin* window)
win_has_attention(ProfWin* window)
{
if (window->type == WIN_CHAT) {
ProfChatWin* chatwin = (ProfChatWin*)window;
@@ -1857,8 +1857,8 @@ win_has_attention(ProfWin* window)
return FALSE;
}
gboolean
win_toggle_attention(ProfWin* window)
gboolean
win_toggle_attention(ProfWin* window)
{
if (window->type == WIN_CHAT) {
ProfChatWin* chatwin = (ProfChatWin*)window;
@@ -1874,7 +1874,6 @@ win_toggle_attention(ProfWin* window)
return FALSE;
}
void
win_sub_print(WINDOW* win, char* msg, gboolean newline, gboolean wrap, int indent)
{

View File

@@ -1210,7 +1210,7 @@ wins_get_next_unread(void)
GList* curr = values;
while (curr) {
int curr_win_num = GPOINTER_TO_INT(curr->data);
int curr_win_num = GPOINTER_TO_INT(curr->data);
ProfWin* window = wins_get_by_num(curr_win_num);
// test if window has unread messages