changeset 87:f600615c490d

[/trunk] Changeset 101 by mikael * Add config file option to hide offline buddies.
author mikael
date Mon, 18 Apr 2005 03:19:48 +0000
parents eb2270957c2d
children 3c51989b0982
files mcabber/mcabberrc.example mcabber/src/main.c
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/mcabberrc.example	Sun Apr 17 20:26:38 2005 +0000
+++ b/mcabber/mcabberrc.example	Mon Apr 18 03:19:48 2005 +0000
@@ -12,6 +12,9 @@
 resource = yourresource
 ssl = 0
 
+# Set hide_offline_buddies to 1 to display only connected buddies
+# in the roster.
+#hide_offline_buddies = 0
 
 #  The colors
 # NOTE: the following settings may or may not be used currently... :)
--- a/mcabber/src/main.c	Sun Apr 17 20:26:38 2005 +0000
+++ b/mcabber/src/main.c	Mon Apr 18 03:19:48 2005 +0000
@@ -9,6 +9,7 @@
 #include "jabglue.h"
 #include "screen.h"
 #include "parsecfg.h"
+#include "roster.h"
 #include "lang.h"
 #include "utils.h"
 #include "harddefines.h"
@@ -97,7 +98,6 @@
   signal(SIGTERM, sig_handler);
   signal(SIGALRM, sig_handler);
 
-
   sprintf(configFile, "%s/.mcabberrc", getenv("HOME"));
 
   /* Parse command line options */
@@ -185,6 +185,10 @@
   ut_WriteLog("Entering into main loop...\n\n");
   ut_WriteLog("Ready to send/receive messages...\n");
 
+  if (cfg_read("hide_offline_buddies") &&
+      (atoi(cfg_read("hide_offline_buddies")) > 0))
+    buddylist_hide_offline_buddies(TRUE);
+
   keypad(scr_GetInputWindow(), TRUE);
   while (ret != 255) {
     alarm(ping);