Fix service triggers; allow service hostname configuration; fix glitches
[srvx.git] / src / global.c
index cd6a43c1b081ce4a9a6f0470eeec267cdcc7aee6..dc7dc4f0f381c73c3a9d3c842478f7cf3cbe7192 100644 (file)
@@ -1,11 +1,12 @@
 /* global.c - Global notice service
  * Copyright 2000-2004 srvx Development Team
  *
- * This program is free software; you can redistribute it and/or modify
+ * This file is part of srvx.
+ *
+ * srvx is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.  Important limitations are
- * listed in the COPYING file that accompanies this software.
+ * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -13,7 +14,8 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, email srvx-maintainers@srvx.net.
+ * along with srvx; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
 
 #include "conf.h"
@@ -440,13 +442,9 @@ static GLOBAL_FUNC(cmd_list)
         table.contents[nn][0] = strdup(buffer);
         table.contents[nn][1] = messageType(message);
         if(message->duration)
-        {
-            intervalString(buffer, message->posted + message->duration - now);
-        }
+            intervalString(buffer, message->posted + message->duration - now, user->handle_info);
         else
-        {
             strcpy(buffer, "Never.");
-        }
         table.contents[nn][2] = strdup(buffer);
         table.contents[nn][3] = message->from;
        length = strlen(message->message);
@@ -676,8 +674,8 @@ init_global(const char *nick)
 
     if(nick)
     {
-        global = AddService(nick, "Global Services");
-        global_service = service_register(global, 0);
+        global = AddService(nick, "Global Services", NULL);
+        global_service = service_register(global);
     }
     saxdb_register("Global", global_saxdb_read, global_saxdb_write);
     reg_exit_func(global_db_cleanup);