Преглед на файлове

Initial XChat -> HexChat replacement due to XChat masking in-tree

SASL is apparently supported by HexChat, so custom plugin is not
necessary.

No OTR plugin is available for HexChat in main tree.

TODO: Configuration.
Maxim Kammerer преди 12 години
родител
ревизия
1d9009e20e

+ 1 - 0
doc/changelog.txt

@@ -16,6 +16,7 @@
   * Added proxychains, a heterogeneous chaining proxyfier
   * Removed experimental I2P support and JamVM
   * Removed FBReader due to its transition to Qt
+  * Replaced XChat with HexChat
 
 
 2012-09-01

+ 2 - 2
doc/info.txt

@@ -59,12 +59,12 @@ wget                    ssl, gnutls             ssl             portage, libqalc
 claws-mail              gnutls                  gnutls
 libetpan                ssl, gnutls             gnutls          claws-mail
 cyrus-sasl              ssl                     ssl             pidgin
-xchat                   ssl                     ssl
+hexchat                 ssl                     ssl
 pidgin                  gnutls, nss             gnutls
 gftp                    ssl                     ssl
 
 
-libgcrypt users: cryptsetup, gnupg, gnome-keyring, libotr(pidgin-otr, xchat-otr),
+libgcrypt users: cryptsetup, gnupg, gnome-keyring, libotr(pidgin-otr),
                  networkmanager, glib-networking, gnupg-pkcs11-scd, ntfs3g
 
 

+ 1 - 0
src/etc/portage/package.use/all

@@ -42,6 +42,7 @@ dev-libs/opensc                 -ssl
 app-i18n/uim                    -ssl
 www-client/epiphany             -nss
 net-libs/glib-networking        -gnome
+net-irc/hexchat                 libproxy
 
 # Multimedia
 # [ffmpeg/libav: encode-only flags: mp3 aac aacplus faac theora vorbis x264 xvid]

+ 1 - 2
src/etc/portage/sets/apps

@@ -43,7 +43,7 @@ mail-client/claws-mail
 app-crypt/gpa
 sci-calculators/qalculate-gtk
 www-client/epiphany
-net-irc/xchat
+net-irc/hexchat
 net-im/pidgin
 net-ftp/gftp
 www-client/uget
@@ -60,6 +60,5 @@ media-plugins/gst-plugins-libpng:0.10
 media-plugins/gst-plugins-speex:0.10
 media-plugins/gst-plugins-ximagesrc:0.10
 www-client/epiphany-extensions
-net-irc/xchat-otr
 x11-plugins/pidgin-otr
 x11-plugins/pidgin-libnotify

+ 3 - 0
src/home/anon/bin/wrappers/hexchat

@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /usr/bin/hexchat -d ${XDG_CONFIG_HOME}/hexchat "$@"

+ 0 - 3
src/home/anon/bin/wrappers/xchat

@@ -1,3 +0,0 @@
-#!/bin/sh
-
-exec /usr/bin/xchat -d ${XDG_CONFIG_HOME}/xchat "$@"

+ 0 - 0
src/home/anon/config/hexchat/.keep


+ 1 - 3
src/root/setup

@@ -281,15 +281,13 @@ gcc  ${cflags} -o /usr/local/sbin/udev-watchdog      /usr/local/src/udev-watchdo
 gcc  ${cflags} -o /usr/local/sbin/slay               /usr/local/src/slay.c
 gcc  ${cflags} -o /usr/local/sbin/privsh             /usr/local/src/privsh.c
 gcc  ${cflags} -o /usr/local/bin/log-limit           /usr/local/src/log-limit.c
-gcc  ${cflags} -o /usr/lib/xchat/plugins/cap_sasl.so /usr/local/src/cap_sasl.c -shared -fPIC \
-     -D _GNU_SOURCE -I /usr/include/glib-2.0 -I /usr/lib/glib-2.0/include -Wl,--export-dynamic
 
 cflags="-Wall `portageq envvar CFLAGS`"
 mkdir -p /usr/local/addons/initrd
 klcc ${cflags} -o /usr/local/addons/initrd/init-kexec /usr/local/src/init-kexec.c
 
 strip -s /usr/local/{sbin/{udev-watchdog,slay,privsh},bin/log-limit} \
-         /usr/local/addons/initrd/init-kexec /usr/lib/xchat/plugins/cap_sasl.so
+         /usr/local/addons/initrd/init-kexec
 
 
 sinfo "Generating localization, timezone and keyboard layout menus"

+ 0 - 214
src/usr/local/src/cap_sasl.c

@@ -1,214 +0,0 @@
-/*
- * SASL authentication plugin for XChat
- * Extremely primitive: only PLAIN, no error checking
- *
- * Copyright (c) 2010, <ygrek@autistici.org>
- *
- * Docs:
- *  http://hg.atheme.org/charybdis/charybdis/file/6144f52a119b/doc/sasl.txt
- *  http://tools.ietf.org/html/rfc4422
- */
-
-
-#include <string.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <glib.h>
-
-#include <xchat/xchat-plugin.h>
-
-#define PNAME "cap_sasl"
-#define PDESC "SASL authentication plugin";
-#define PVERSION "0.0.4"
-
-static xchat_plugin *ph;   /* plugin handle */
-
-struct sasl_info;
-
-struct sasl_info
-{
-  char const* login;
-  char const* password;
-  char const* network;
-  struct sasl_info* next;
-};
-
-typedef struct sasl_info sasl_info;
-
-sasl_info* all_info = NULL;
-
-static void add_info(char const* login, char const* password, char const* network)
-{
-  sasl_info* prev = all_info;
-  sasl_info* info = (sasl_info*)malloc(sizeof(sasl_info));
-
-  info->login = strdup(login);
-  info->password = strdup(password);
-  info->network = strdup(network);
-  info->next = prev;
-
-  all_info = info;
-}
-
-static sasl_info* find_info(char const* network)
-{
-  sasl_info* cur = all_info;
-  while (cur)
-  {
-    if (0 == strcmp(cur->network, network)) return cur;
-    cur = cur->next;
-  }
-  return NULL;
-}
-
-static sasl_info* get_info(void)
-{
-  const char* name = xchat_get_info(ph, "network");
-  if (name)
-    return find_info(name);
-  else
-    return NULL;
-}
-
-static int authend_cb(char *word[], char *word_eol[], void *userdata)
-{
-  if (get_info())
-  {
-    xchat_printf(ph, "cap_sasl result: %s", word_eol[1]);
-    xchat_commandf(ph, "QUOTE CAP END");
-  }
-  return XCHAT_EAT_ALL;
-}
-
-/*
-static int disconnect_cb(char *word[], void *userdata)
-{
-  xchat_printf(ph, "disconnected");
-  return XCHAT_EAT_NONE;
-}
-*/
-
-static int server_cb(char *word[], char *word_eol[], void *userdata)
-{
-  if (0 == strcmp("AUTHENTICATE",word[1]) && 0 == strcmp("+",word[2]))
-  {
-    sasl_info* p = get_info();
-    if (!p) return XCHAT_EAT_NONE;
-
-    xchat_printf(ph,"cap_sasl authenticating as %s",p->login);
-
-    size_t len = strlen(p->login)*2 + 2 + strlen(p->password);
-    char* buf = (char*)malloc(len + 1);
-    strcpy(buf,p->login);
-    strcpy(buf+strlen(p->login)+1,p->login);
-    strcpy(buf+strlen(p->login)*2+2,p->password);
-    char* enc = g_base64_encode((unsigned char*)buf,len);
-
-    /*xchat_printf(ph,"AUTHENTICATE %s",enc);*/
-    xchat_commandf(ph,"QUOTE AUTHENTICATE %s",enc);
-
-    free(enc);
-    free(buf);
-
-    return XCHAT_EAT_ALL;
-  }
-        return XCHAT_EAT_NONE;
-}
-
-static int cap_cb(char *word[], char *word_eol[], void *userdata)
-{
-  if (get_info())
-  {
-    /* FIXME test sasl cap */
-    xchat_printf(ph, "cap_sasl info: %s", word_eol[1]);
-    xchat_commandf(ph,"QUOTE AUTHENTICATE PLAIN");
-  }
-
-  return XCHAT_EAT_ALL;
-}
-
-static int sasl_cmd_cb(char *word[], char *word_eol[], void *userdata)
-{
-  const char* login = word[2];
-  const char* password = word[3];
-  const char* network = word_eol[4];
-
-  if (!login || !*login)
-  {
-    sasl_info *cur = all_info;
-    if (NULL == cur)
-    {
-      xchat_printf(ph,"Nothing, see /help sasl");
-      return XCHAT_EAT_ALL;
-    }
-
-    while (cur)
-    {
-      xchat_printf(ph,"%s:%s at %s",cur->login,cur->password,cur->network);
-      cur = cur->next;
-    }
-    return XCHAT_EAT_ALL;
-  }
-
-  if (!login || !password || !network || !*login || !*password || !*network)
-  {
-    xchat_printf(ph,"Wrong usage, try /help sasl");
-    return XCHAT_EAT_ALL;
-  }
-
-  add_info(login,password,network);
-
-  xchat_printf(ph,"Enabled SASL authentication for %s",network);
-
-  return XCHAT_EAT_ALL;
-}
-
-static int connect_cb(char *word[], void *userdata)
-{
-  if (get_info())
-  {
-    xchat_printf(ph, "cap_sasl enabled");
-    xchat_commandf(ph, "QUOTE CAP REQ :sasl");
-  }
-
-  return XCHAT_EAT_NONE;
-}
-
-int xchat_plugin_init(xchat_plugin *plugin_handle,
-                      char **plugin_name,
-                      char **plugin_desc,
-                      char **plugin_version,
-                      char *arg)
-{
-  /* we need to save this for use with any xchat_* functions */
-  ph = plugin_handle;
-
-  /* tell xchat our info */
-  *plugin_name = PNAME;
-  *plugin_desc = PDESC;
-  *plugin_version = PVERSION;
-
-  xchat_hook_command(ph, "sasl", XCHAT_PRI_NORM, sasl_cmd_cb,
-    "Usage: SASL <login> <password> <network>, enable SASL authentication for given network", 0);
-
-  xchat_hook_print(ph, "Connected", XCHAT_PRI_NORM, connect_cb, NULL);
-/*
-  xchat_hook_print(ph, "Disconnected", XCHAT_PRI_NORM, disconnect_cb, NULL);
-*/
-
-  xchat_hook_server(ph, "CAP", XCHAT_PRI_NORM, cap_cb, NULL);
-  xchat_hook_server(ph, "RAW LINE", XCHAT_PRI_NORM, server_cb, NULL);
-
-  xchat_hook_server(ph, "903", XCHAT_PRI_NORM, authend_cb, NULL);
-  xchat_hook_server(ph, "904", XCHAT_PRI_NORM, authend_cb, NULL);
-  xchat_hook_server(ph, "905", XCHAT_PRI_NORM, authend_cb, NULL);
-  xchat_hook_server(ph, "906", XCHAT_PRI_NORM, authend_cb, NULL);
-  xchat_hook_server(ph, "907", XCHAT_PRI_NORM, authend_cb, NULL);
-
-  xchat_print(ph,"Loading cap_sasl.conf");
-  xchat_commandf(ph, "load -e %s/cap_sasl.conf",xchat_get_info(ph, "xchatdir"));
-
-  xchat_print(ph, "cap_sasl plugin " PVERSION " loaded");
-
-  return 1;
-}