diff mcabber/src/settings.c @ 521:cc8c969ab6e5

"/status" changes - No hardcoded status message - If there is no user-defined status message, the current message is kept - "/status $status -" clears the status message - Auto-away improvement
author Mikael Berthe <mikael@lilotux.net>
date Sat, 19 Nov 2005 16:30:49 +0100
parents f8f3c7493457
children 8b3db0b555a1
line wrap: on
line diff
--- a/mcabber/src/settings.c	Mon Nov 14 22:15:25 2005 +0100
+++ b/mcabber/src/settings.c	Sat Nov 19 16:30:49 2005 +0100
@@ -298,8 +298,7 @@
 //   return this message
 // - if there is a user-defined message for the given status (and no
 //   generic user message), it is returned
-// - if no user-defined message is found, return the mcabber default msg
-// - if there is no default (offline, invisible), return an empty string
+// - if no message is found, return NULL
 const gchar *settings_get_status_msg(enum imstatus status)
 {
   const gchar *rstatus = settings_opt_get("message");
@@ -308,32 +307,27 @@
 
   switch(status) {
     case available:
-        if ((rstatus = settings_opt_get("message_avail")) == NULL)
-          rstatus = MSG_AVAIL;
+        rstatus = settings_opt_get("message_avail");
         break;
 
     case freeforchat:
-        if ((rstatus = settings_opt_get("message_free")) == NULL)
-          rstatus = MSG_FREE;
+        rstatus = settings_opt_get("message_free");
         break;
 
     case dontdisturb:
-        if ((rstatus = settings_opt_get("message_dnd")) == NULL)
-          rstatus = MSG_DND;
+        rstatus = settings_opt_get("message_dnd");
         break;
 
     case notavail:
-        if ((rstatus = settings_opt_get("message_notavail")) == NULL)
-          rstatus = MSG_NOTAVAIL;
+        rstatus = settings_opt_get("message_notavail");
         break;
 
     case away:
-        if ((rstatus = settings_opt_get("message_away")) == NULL)
-          rstatus = MSG_AWAY;
+        rstatus = settings_opt_get("message_away");
         break;
 
-    default:
-        rstatus = "";
+    default: // offline, invisible
+        break;
   }
   return rstatus;
 }