about summary refs log tree commit diff stats
path: root/src/ui
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2021-10-05 10:01:27 +0200
committerMichael Vetter <jubalh@iodoru.org>2021-10-05 10:01:27 +0200
commitf21595597f4fa872b77d7f76ae04916f4aae732e (patch)
treef0d4dec07da9a695a8627575b1837ba26441e911 /src/ui
parent7e8cf4a3d680ef5b8f056021846818fb526635d9 (diff)
downloadprofani-tty-f21595597f4fa872b77d7f76ae04916f4aae732e.tar.gz
Format code correctly
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/chatwin.c4
-rw-r--r--src/ui/console.c9
-rw-r--r--src/ui/core.c1
-rw-r--r--src/ui/inputwin.c9
-rw-r--r--src/ui/mucwin.c2
-rw-r--r--src/ui/notifier.c2
-rw-r--r--src/ui/ui.h2
-rw-r--r--src/ui/window.c7
-rw-r--r--src/ui/window_list.c2
9 files changed, 20 insertions, 18 deletions
diff --git a/src/ui/chatwin.c b/src/ui/chatwin.c
index 4dfe50ed..1c33e6c3 100644
--- a/src/ui/chatwin.c
+++ b/src/ui/chatwin.c
@@ -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.
diff --git a/src/ui/console.c b/src/ui/console.c
index 15512c77..bdb8f24d 100644
--- a/src/ui/console.c
+++ b/src/ui/console.c
@@ -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);
diff --git a/src/ui/core.c b/src/ui/core.c
index f4ee4a86..3b10888b 100644
--- a/src/ui/core.c
+++ b/src/ui/core.c
@@ -1009,7 +1009,6 @@ ui_win_has_attention(int index)
     return ret;
 }
 
-
 char*
 ui_ask_password(gboolean confirm)
 {
diff --git a/src/ui/inputwin.c b/src/ui/inputwin.c
index 3e2f6a67..4ea773c8 100644
--- a/src/ui/inputwin.c
+++ b/src/ui/inputwin.c
@@ -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)
 {
diff --git a/src/ui/mucwin.c b/src/ui/mucwin.c
index a0717282..5bf21722 100644
--- a/src/ui/mucwin.c
+++ b/src/ui/mucwin.c
@@ -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, "");
diff --git a/src/ui/notifier.c b/src/ui/notifier.c
index a9aa38c7..9a0eb291 100644
--- a/src/ui/notifier.c
+++ b/src/ui/notifier.c
@@ -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);
 }
diff --git a/src/ui/ui.h b/src/ui/ui.h
index dc2fc497..bb81dfc3 100644
--- a/src/ui/ui.h
+++ b/src/ui/ui.h
@@ -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);
diff --git a/src/ui/window.c b/src/ui/window.c
index 4fb7d5f7..3123e211 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -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)
 {
diff --git a/src/ui/window_list.c b/src/ui/window_list.c
index d698d778..01379804 100644
--- a/src/ui/window_list.c
+++ b/src/ui/window_list.c
@@ -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