changeset 717:8ce2bfdc4143

Reindent update_chat_status_window()
author Mikael Berthe <mikael@lilotux.net>
date Sat, 04 Mar 2006 23:27:33 +0100
parents ba1137a01078
children b41799901abd
files mcabber/src/screen.c
diffstat 1 files changed, 50 insertions(+), 50 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/src/screen.c	Sat Mar 04 23:19:24 2006 +0100
+++ b/mcabber/src/screen.c	Sat Mar 04 23:27:33 2006 +0100
@@ -721,65 +721,65 @@
 // Set forceupdate to TRUE if doupdate() must be called.
 static void update_chat_status_window(int forceupdate)
 {
-    unsigned short btype, isgrp, ismuc;
-    const char *fullname;
-    const char *msg = NULL;
-    char status;
-    char *buf;
-
-    fullname = buddy_getname(BUDDATA(current_buddy));
-    btype = buddy_gettype(BUDDATA(current_buddy));
-
-    isgrp = btype & ROSTER_TYPE_GROUP;
-    ismuc = btype & ROSTER_TYPE_ROOM;
+  unsigned short btype, isgrp, ismuc;
+  const char *fullname;
+  const char *msg = NULL;
+  char status;
+  char *buf;
 
-    // Clear the line
-    werase(chatstatusWnd);
-
-    if (chatmode)
-      wprintw(chatstatusWnd, "");
-
-    if (isgrp) {
-      mvwprintw(chatstatusWnd, 0, 5, "Group: %s", fullname);
-      if (forceupdate) {
-        update_panels();
-        doupdate();
-      }
-      return;
-    }
+  fullname = buddy_getname(BUDDATA(current_buddy));
+  btype = buddy_gettype(BUDDATA(current_buddy));
 
-    status = '?';
+  isgrp = btype & ROSTER_TYPE_GROUP;
+  ismuc = btype & ROSTER_TYPE_ROOM;
 
-    if (ismuc) {
-      if (buddy_getinsideroom(BUDDATA(current_buddy)))
-        status = 'C';
-      else
-        status = 'x';
-    } else if (jb_getstatus() != offline) {
-      enum imstatus budstate;
-      budstate = buddy_getstatus(BUDDATA(current_buddy), NULL);
-      if (budstate >= 0 && budstate < imstatus_size)
-        status = imstatus2char[budstate];
-    }
+  // Clear the line
+  werase(chatstatusWnd);
 
-    // No status message for groups & MUC rooms
-    if (!isgrp && !ismuc) {
-      GSList *resources = buddy_getresources(BUDDATA(current_buddy));
-      if (resources)
-        msg = buddy_getstatusmsg(BUDDATA(current_buddy), resources->data);
-    }
-    if (!msg)
-      msg = "";
+  if (chatmode)
+    wprintw(chatstatusWnd, "");
 
-    buf = g_strdup_printf("[%c] Buddy: %s -- %s", status, fullname, msg);
-    replace_nl_with_dots(buf);
-    mvwprintw(chatstatusWnd, 0, 1, "%s", buf);
-    g_free(buf);
-
+  if (isgrp) {
+    mvwprintw(chatstatusWnd, 0, 5, "Group: %s", fullname);
     if (forceupdate) {
       update_panels();
       doupdate();
     }
+    return;
+  }
+
+  status = '?';
+
+  if (ismuc) {
+    if (buddy_getinsideroom(BUDDATA(current_buddy)))
+      status = 'C';
+    else
+      status = 'x';
+  } else if (jb_getstatus() != offline) {
+    enum imstatus budstate;
+    budstate = buddy_getstatus(BUDDATA(current_buddy), NULL);
+    if (budstate >= 0 && budstate < imstatus_size)
+      status = imstatus2char[budstate];
+  }
+
+  // No status message for groups & MUC rooms
+  if (!isgrp && !ismuc) {
+    GSList *resources = buddy_getresources(BUDDATA(current_buddy));
+    if (resources)
+      msg = buddy_getstatusmsg(BUDDATA(current_buddy), resources->data);
+  }
+  if (!msg)
+    msg = "";
+
+  buf = g_strdup_printf("[%c] Buddy: %s -- %s", status, fullname, msg);
+  replace_nl_with_dots(buf);
+  mvwprintw(chatstatusWnd, 0, 1, "%s", buf);
+  g_free(buf);
+
+  if (forceupdate) {
+    update_panels();
+    doupdate();
+  }
 }
 
 //  scr_DrawRoster()