pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/chat/irssi-icb Better support /who and /whereis.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/739c0a6e86d2
branches:  trunk
changeset: 471452:739c0a6e86d2
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Sun Mar 28 20:09:20 2004 +0000

description:
Better support /who and /whereis.
Divert server messages to the server window instead of the channel window.
[Sent back to the author.]
Bump PKGREVISION to 5.

diffstat:

 chat/irssi-icb/Makefile         |   4 +-
 chat/irssi-icb/distinfo         |   4 +-
 chat/irssi-icb/patches/patch-ab |  98 +++++++++++++++++++++++++++++++++++++++++
 chat/irssi-icb/patches/patch-ac |  12 +++++
 4 files changed, 115 insertions(+), 3 deletions(-)

diffs (146 lines):

diff -r acf9acb232a9 -r 739c0a6e86d2 chat/irssi-icb/Makefile
--- a/chat/irssi-icb/Makefile   Sun Mar 28 20:09:07 2004 +0000
+++ b/chat/irssi-icb/Makefile   Sun Mar 28 20:09:20 2004 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.9 2004/03/26 02:27:35 wiz Exp $
+# $NetBSD: Makefile,v 1.10 2004/03/28 20:09:20 wiz Exp $
 #
 
 DISTNAME=      irssi-icb-0.14
-PKGREVISION=   4
+PKGREVISION=   5
 CATEGORIES=    chat
 MASTER_SITES=  http://www.irssi.org/files/plugins/icb/
 DISTFILES=     ${DISTNAME}.tar.gz ${IRSSI_DISTFILE}
diff -r acf9acb232a9 -r 739c0a6e86d2 chat/irssi-icb/distinfo
--- a/chat/irssi-icb/distinfo   Sun Mar 28 20:09:07 2004 +0000
+++ b/chat/irssi-icb/distinfo   Sun Mar 28 20:09:20 2004 +0000
@@ -1,7 +1,9 @@
-$NetBSD: distinfo,v 1.3 2003/12/11 20:20:54 veego Exp $
+$NetBSD: distinfo,v 1.4 2004/03/28 20:09:20 wiz Exp $
 
 SHA1 (irssi-icb-0.14.tar.gz) = 31d7a5d04a896e0e19db44b4d76b7ac85af1a5d4
 Size (irssi-icb-0.14.tar.gz) = 172647 bytes
 SHA1 (irssi-0.8.9.tar.bz2) = 57799a1e99ac5f6694eb6fd049d39a4e2e51f576
 Size (irssi-0.8.9.tar.bz2) = 816465 bytes
 SHA1 (patch-aa) = 8249c9ae3e5ae8b6110db030ee4280aa53ca1192
+SHA1 (patch-ab) = c270c35891164c9e42696e2ffc84d1e7ffaaaa2a
+SHA1 (patch-ac) = b9a7443be1356b56efff6263b9387684686ff194
diff -r acf9acb232a9 -r 739c0a6e86d2 chat/irssi-icb/patches/patch-ab
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/chat/irssi-icb/patches/patch-ab   Sun Mar 28 20:09:20 2004 +0000
@@ -0,0 +1,98 @@
+$NetBSD: patch-ab,v 1.1 2004/03/28 20:09:20 wiz Exp $
+
+--- src/fe-common/fe-icb.c.orig        Sat Apr 27 22:56:18 2002
++++ src/fe-common/fe-icb.c
+@@ -18,6 +18,8 @@
+     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+ 
++#include <time.h>
++
+ #include "module.h"
+ #include "module-formats.h"
+ #include "signals.h"
+@@ -84,12 +86,67 @@ static void event_personal(ICB_SERVER_RE
+         icb_split_free(args);
+ }
+ 
++static void idle_time(char *buf, size_t bufsize, time_t idle)
++{
++#define MIN_LEN               60UL
++#define HOUR_LEN      3600UL
++#define DAY_LEN               86400UL
++#define WEEK_LEN      604800UL
++
++      if (idle >= WEEK_LEN)
++              snprintf(buf, bufsize, "%2dw%2dd",
++                       (int)(idle/WEEK_LEN), (int)((idle%WEEK_LEN)/DAY_LEN));
++      else if (idle >= DAY_LEN)
++              snprintf(buf, bufsize, "%2dd%2dh",
++                       (int)(idle/DAY_LEN), (int)((idle%DAY_LEN)/HOUR_LEN));
++      else if (idle >= HOUR_LEN)
++              snprintf(buf, bufsize, "%2dh%2dm",
++                       (int)(idle/HOUR_LEN), (int)((idle%HOUR_LEN)/MIN_LEN));
++      else if (idle >= MIN_LEN)
++              snprintf(buf, bufsize, "%2dm%2ds",
++                       (int)(idle/MIN_LEN), (int)(idle%MIN_LEN));
++      else
++              snprintf(buf, bufsize, "   %2ds", (int)idle);
++}
++
++static void cmdout_wl(ICB_SERVER_REC *server, char **args)
++{
++      struct tm *logintime;
++      char logbuf[20];
++      char idlebuf[20];
++      char line[255];
++      time_t temptime;
++
++      /* "wl" : In a who listing, a line of output listing a user. Has the following format:
++
++      * Field 1: String indicating whether user is moderator or not. Usually "*" for
++      * moderator, and " " for not.
++      * Field 2: Nickname of user.
++      * Field 3: Number of seconds user has been idle.
++      * Field 4: Response Time. No longer in use.
++      * Field 5: Login Time. Unix time_t format. Seconds since Jan. 1, 1970 GMT.
++      * Field 6: Username of user.
++      * Field 7: Hostname of user.
++      * Field 8: Registration status.
++      */
++      temptime = strtol(args[4], NULL, 10);
++      logintime = gmtime(&temptime);
++      strftime(logbuf, sizeof(logbuf), "%b %e %H:%M", logintime);
++      temptime = strtol(args[2], NULL, 10);
++      idle_time(idlebuf, sizeof(idlebuf), temptime);
++
++      snprintf(line, sizeof(line), "*** %c%-14.14s %6.6s %12.12s %s@%s %s",
++                args[0][0] == ' '?' ':'*', args[1], idlebuf, logbuf, args[5],
++                args[6], args[7]);
++      printtext(server, NULL, MSGLEVEL_CRAP, line);
++}
++
+ static void cmdout_default(ICB_SERVER_REC *server, char **args)
+ {
+       char *data;
+ 
+       data = g_strjoinv(" ", args+1);
+-      printtext(server, server->group->name, MSGLEVEL_CRAP, "%s", data);
++      printtext(server, NULL, MSGLEVEL_CRAP, "%s", data);
+         g_free(data);
+ }
+ 
+@@ -115,6 +172,7 @@ void fe_icb_init(void)
+         signal_add("icb event beep", (SIGNAL_FUNC) event_beep);
+         signal_add("icb event open", (SIGNAL_FUNC) event_open);
+         signal_add("icb event personal", (SIGNAL_FUNC) event_personal);
++        signal_add("icb cmdout wl", (SIGNAL_FUNC) cmdout_wl);
+         signal_add("default icb cmdout", (SIGNAL_FUNC) cmdout_default);
+ 
+       signal_add("server add fill", (SIGNAL_FUNC) sig_server_add_fill);
+@@ -131,6 +189,7 @@ void fe_icb_deinit(void)
+         signal_remove("icb event beep", (SIGNAL_FUNC) event_beep);
+         signal_remove("icb event open", (SIGNAL_FUNC) event_open);
+         signal_remove("icb event personal", (SIGNAL_FUNC) event_personal);
++        signal_remove("icb cmdout wl", (SIGNAL_FUNC) cmdout_wl);
+         signal_remove("default icb cmdout", (SIGNAL_FUNC) cmdout_default);
+ 
+       signal_remove("server add fill", (SIGNAL_FUNC) sig_server_add_fill);
diff -r acf9acb232a9 -r 739c0a6e86d2 chat/irssi-icb/patches/patch-ac
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/chat/irssi-icb/patches/patch-ac   Sun Mar 28 20:09:20 2004 +0000
@@ -0,0 +1,12 @@
+$NetBSD: patch-ac,v 1.1 2004/03/28 20:09:20 wiz Exp $
+
+--- src/core/icb-commands.c.orig       Sat May  4 19:21:43 2002
++++ src/core/icb-commands.c
+@@ -32,6 +32,7 @@ static char *icb_commands[] = {
+ 
+       "invite", "v", "echoback", "name", "motd", "topic", "status",
+       "boot", "pass", "drop", "shutdown", "wall",
++      "whereis",
+         NULL
+ };
+ 



Home | Main Index | Thread Index | Old Index