Compare commits

...
Sign in to create a new pull request.

6 commits

23 changed files with 1 additions and 5060 deletions

1
.gitignore vendored
View file

@ -1 +0,0 @@
xchat-2.8.8.tar.xz

View file

@ -1,37 +0,0 @@
From 527eb322a5bfa97d5716e7f8178e319c515065a2 Mon Sep 17 00:00:00 2001
From: Marc Deslauriers <marc.deslauriers@ubuntu.com>
Date: Mon, 20 Oct 2014 10:08:26 -0400
Subject: [PATCH] Don't force the use of SSLv3.
SSLv3 should no longer be used for security reasons. Let the best
connection method be automatically determined by using SSLv23_client_method()
and SSLv23_server_method().
---
src/common/ssl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/ssl.c b/src/common/ssl.c
index a18ad47..35eb237 100644
--- a/src/common/ssl.c
+++ b/src/common/ssl.c
@@ -70,7 +70,7 @@ _SSL_context_init (void (*info_cb_func), int server)
SSLeay_add_ssl_algorithms ();
SSL_load_error_strings ();
- ctx = SSL_CTX_new (server ? SSLv3_server_method() : SSLv3_client_method ());
+ ctx = SSL_CTX_new (server ? SSLv23_server_method() : SSLv23_client_method ());
SSL_CTX_set_session_cache_mode (ctx, SSL_SESS_CACHE_BOTH);
SSL_CTX_set_timeout (ctx, 300);
@@ -281,7 +281,7 @@ _SSL_socket (SSL_CTX *ctx, int sd)
__SSL_critical_error ("SSL_new");
SSL_set_fd (ssl, sd);
- if (ctx->method == SSLv3_client_method())
+ if (ctx->method == SSLv23_client_method())
SSL_set_connect_state (ssl);
else
SSL_set_accept_state(ssl);
--
2.1.0

1
dead.package Normal file
View file

@ -0,0 +1 @@
XChat is dead. The recommended replacement is HexChat.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

View file

@ -1 +0,0 @@
9a11f13121ff0af787bba3b014378e58 xchat-2.8.8.tar.xz

View file

@ -1,34 +0,0 @@
--- src/common/util.c.use-sysconf-to-detect-cpus Tue Feb 5 07:44:27 2002
+++ src/common/util.c Tue Feb 5 07:45:59 2002
@@ -399,14 +399,11 @@
int fh;
*mhz = 0;
- *cpus = 0;
+ *cpus = (int) sysconf(_SC_NPROCESSORS_ONLN);
fh = open ("/proc/cpuinfo", O_RDONLY); /* linux 2.2+ only */
if (fh == -1)
- {
- *cpus = 1;
return;
- }
while (1)
{
@@ -421,15 +418,9 @@
} else if (!strncmp (buf, "clock\t\t:", 8)) /* PPC */
{
*mhz = atoi (buf + 9);
- } else if (!strncmp (buf, "processor\t", 10))
- {
- (*cpus)++;
}
}
close (fh);
- if (!*cpus)
- *cpus = 1;
-
#endif
#ifdef USING_FREEBSD

View file

@ -1,339 +0,0 @@
diff -paur xchat2.orig/src/common/inbound.c xchat2/src/common/inbound.c
--- xchat2.orig/src/common/inbound.c 2008-07-20 17:31:44.898468115 +0200
+++ xchat2/src/common/inbound.c 2008-07-19 19:57:09.799906780 +0200
@@ -297,7 +297,10 @@ is_hilight (char *from, char *text, sess
{
g_free (text);
if (sess != current_tab)
+ {
sess->nick_said = TRUE;
+ lastact_update(sess);
+ }
fe_set_hilight (sess);
return 1;
}
@@ -344,6 +347,7 @@ inbound_action (session *sess, char *cha
sess->msg_said = TRUE;
sess->new_data = FALSE;
}
+ lastact_update(sess);
}
user = userlist_find (sess, from);
@@ -395,6 +399,7 @@ inbound_chanmsg (server *serv, session *
{
sess->msg_said = TRUE;
sess->new_data = FALSE;
+ lastact_update(sess);
}
user = userlist_find (sess, from);
diff -paur xchat2.orig/src/common/xchat.c xchat2/src/common/xchat.c
--- xchat2.orig/src/common/xchat.c 2008-07-20 17:31:44.900468825 +0200
+++ xchat2/src/common/xchat.c 2008-07-20 17:33:57.089468218 +0200
@@ -71,6 +71,23 @@ GSList *usermenu_list = 0;
GSList *urlhandler_list = 0;
GSList *tabmenu_list = 0;
+/*
+ * This array contains 5 double linked lists, one for each priority in the
+ * "interesting session" queue ("channel" stands for everything but
+ * SESS_DIALOG):
+ *
+ * [0] queries with hilight
+ * [1] queries
+ * [2] channels with hilight
+ * [3] channels with dialogue
+ * [4] channels with other data
+ *
+ * Each time activity happens the corresponding session is put at the
+ * beginning of one of the lists. The aim is to be able to switch to the
+ * session with the most important/recent activity.
+ */
+GList *sess_list_by_lastact[5] = {NULL, NULL, NULL, NULL, NULL};
+
static int in_xchat_exit = FALSE;
int xchat_is_quitting = FALSE;
/* command-line args */
@@ -93,6 +110,105 @@ struct xchatprefs prefs;
SSL_CTX *ctx = NULL;
#endif
+/*
+ * Update the priority queue of the "interesting sessions"
+ * (sess_list_by_lastact).
+ */
+void
+lastact_update(session *sess)
+{
+ int newidx;
+
+ /* Find the priority (for the order see before) */
+ if (sess->type == SESS_DIALOG)
+ {
+ if (sess->nick_said)
+ newidx = LACT_QUERY_HI;
+ else if (sess->msg_said)
+ newidx = LACT_QUERY;
+ else if (sess->new_data)
+ newidx = LACT_QUERY;
+ else
+ newidx = LACT_NONE;
+ }
+ else
+ {
+ if (sess->nick_said)
+ newidx = LACT_CHAN_HI;
+ else if (sess->msg_said)
+ newidx = LACT_CHAN;
+ else if (sess->new_data)
+ newidx = LACT_CHAN_DATA;
+ else
+ newidx = LACT_NONE;
+ }
+
+ /* Check if this update is a no-op */
+ if (sess->lastact_idx == newidx &&
+ ((newidx != LACT_NONE && sess->lastact_elem == sess_list_by_lastact[newidx]) ||
+ (newidx == LACT_NONE)))
+ return;
+
+ /* Remove from the old position (and, if no new position, return */
+ else if (sess->lastact_idx != LACT_NONE && sess->lastact_elem)
+ {
+ sess_list_by_lastact[sess->lastact_idx] = g_list_remove_link(
+ sess_list_by_lastact[sess->lastact_idx],
+ sess->lastact_elem);
+ if (newidx == LACT_NONE)
+ {
+ sess->lastact_idx = newidx;
+ return;
+ }
+ }
+
+ /* No previous position, allocate new */
+ else if (!sess->lastact_elem)
+ sess->lastact_elem = g_list_prepend(sess->lastact_elem, sess);
+
+ sess->lastact_idx = newidx;
+ sess_list_by_lastact[newidx] = g_list_concat(
+ sess->lastact_elem, sess_list_by_lastact[newidx]);
+}
+
+/*
+ * Extract the first session from the priority queue of sessions with recent
+ * activity. Return NULL if no such session can be found.
+ *
+ * If filter is specified, skip a session if filter(session) returns 0. This
+ * can be used for UI-specific needs, e.g. in fe-gtk we want to filter out
+ * detached sessions.
+ */
+session *
+lastact_getfirst(int (*filter) (session *sess))
+{
+ int i;
+ session *sess = NULL;
+ GList *curitem;
+
+ /* 5 is the number of priority classes LACT_ */
+ for (i = 0; i < 5 && !sess; i++)
+ {
+ curitem = sess_list_by_lastact[i];
+ while (curitem && !sess)
+ {
+ sess = g_list_nth_data(curitem, 0);
+ if (!sess || (filter && !filter(sess)))
+ {
+ sess = NULL;
+ curitem = g_list_next(curitem);
+ }
+ }
+
+ if (sess)
+ {
+ sess_list_by_lastact[i] = g_list_remove_link(sess_list_by_lastact[i], curitem);
+ sess->lastact_idx = LACT_NONE;
+ }
+ }
+
+ return sess;
+}
int
is_session (session * sess)
@@ -362,6 +478,9 @@ session_new (server *serv, char *from, i
sess_list = g_slist_prepend (sess_list, sess);
+ sess->lastact_elem = NULL;
+ sess->lastact_idx = LACT_NONE;
+
fe_new_window (sess, focus);
return sess;
@@ -533,6 +652,16 @@ session_free (session *killsess)
current_sess = sess_list->data;
}
+ if (killsess->lastact_elem)
+ {
+ if (killsess->lastact_idx != LACT_NONE)
+ sess_list_by_lastact[killsess->lastact_idx] = g_list_delete_link(
+ sess_list_by_lastact[killsess->lastact_idx],
+ killsess->lastact_elem);
+ else
+ g_list_free_1(killsess->lastact_elem);
+ }
+
free (killsess);
if (!sess_list && !in_xchat_exit)
diff -paur xchat2.orig/src/common/xchat.h xchat2/src/common/xchat.h
--- xchat2.orig/src/common/xchat.h 2008-07-20 17:31:44.901467675 +0200
+++ xchat2/src/common/xchat.h 2008-07-20 17:33:28.240467970 +0200
@@ -320,6 +320,15 @@ struct xchatprefs
#define SET_ON 1
#define SET_DEFAULT 2 /* use global setting */
+/* Priorities in the "interesting sessions" priority queue
+ * (see xchat.c:sess_list_by_lastact) */
+#define LACT_NONE -1 /* no queues */
+#define LACT_QUERY_HI 0 /* query with hilight */
+#define LACT_QUERY 1 /* query with messages */
+#define LACT_CHAN_HI 2 /* channel with hilight */
+#define LACT_CHAN 3 /* channel with messages */
+#define LACT_CHAN_DATA 4 /* channel with other data */
+
typedef struct session
{
/* Per-Channel Alerts */
@@ -369,6 +378,10 @@ typedef struct session
int type; /* SESS_* */
+ GList *lastact_elem; /* our GList element in sess_list_by_lastact */
+ int lastact_idx; /* the sess_list_by_lastact[] index of the list we're in.
+ * For valid values, see defines of LACT_*. */
+
int new_data:1; /* new data avail? (purple tab) */
int nick_said:1; /* your nick mentioned? (blue tab) */
int msg_said:1; /* new msg available? (red tab) */
diff -paur xchat2.orig/src/common/xchatc.h xchat2/src/common/xchatc.h
--- xchat2.orig/src/common/xchatc.h 2008-07-20 17:31:44.901467675 +0200
+++ xchat2/src/common/xchatc.h 2008-07-20 11:43:36.673967630 +0200
@@ -25,10 +25,13 @@ extern GSList *ignore_list;
extern GSList *usermenu_list;
extern GSList *urlhandler_list;
extern GSList *tabmenu_list;
+extern GList *sess_list_by_lastact[];
session * find_channel (server *serv, char *chan);
session * find_dialog (server *serv, char *nick);
session * new_ircwindow (server *serv, char *name, int type, int focus);
+void lastact_update (session * sess);
+session * lastact_getfirst (int (*filter) (session *sess));
int is_session (session * sess);
void session_free (session *killsess);
void lag_check (void);
diff -paur xchat2.orig/src/fe-gtk/fe-gtk.c xchat2/src/fe-gtk/fe-gtk.c
--- xchat2.orig/src/fe-gtk/fe-gtk.c 2008-07-20 17:31:44.958466232 +0200
+++ xchat2/src/fe-gtk/fe-gtk.c 2008-07-19 19:58:57.431961788 +0200
@@ -603,6 +603,7 @@ fe_print_text (struct session *sess, cha
sess->gui->is_tab && !sess->nick_said && stamp == 0)
{
sess->new_data = TRUE;
+ lastact_update(sess);
if (sess->msg_said)
fe_set_tab_color (sess, 2);
else
diff -paur xchat2.orig/src/fe-gtk/fkeys.c xchat2/src/fe-gtk/fkeys.c
--- xchat2.orig/src/fe-gtk/fkeys.c 2008-07-20 17:31:44.960465847 +0200
+++ xchat2/src/fe-gtk/fkeys.c 2008-07-20 12:20:50.186930065 +0200
@@ -158,7 +158,7 @@ static const struct key_action key_actio
{key_action_handle_command, "Run Command",
N_("The \002Run Command\002 action runs the data in Data 1 as if it has been typed into the entry box where you pressed the key sequence. Thus it can contain text (which will be sent to the channel/person), commands or user commands. When run all \002\\n\002 characters in Data 1 are used to deliminate seperate commands so it is possible to run more than one command. If you want a \002\\\002 in the actual text run then enter \002\\\\\002")},
{key_action_page_switch, "Change Page",
- N_("The \002Change Page\002 command switches between pages in the notebook. Set Data 1 to the page you want to switch to. If Data 2 is set to anything then the switch will be relative to the current position")},
+ N_("The \002Change Page\002 command switches between pages in the notebook. Set Data 1 to the page you want to switch to. If Data 2 is set to anything then the switch will be relative to the current position. Set Data 1 to auto to switch to the page with the most recent and important activity (queries first, then channels with hilight, channels with dialogue, channels with other data)")},
{key_action_insert, "Insert in Buffer",
N_("The \002Insert in Buffer\002 command will insert the contents of Data 1 into the entry where the key sequence was pressed at the current cursor position")},
{key_action_scroll_page, "Scroll Page",
@@ -402,6 +402,7 @@ key_load_defaults ()
"A\n3\nChange Page\nD1:3\nD2!\n\n"\
"A\n2\nChange Page\nD1:2\nD2!\n\n"\
"A\n1\nChange Page\nD1:1\nD2!\n\n"\
+ "A\ngrave\nChange Page\nD1:auto\nD2!\n\n"\
"C\no\nInsert in Buffer\nD1:\nD2!\n\n"\
"C\nb\nInsert in Buffer\nD1:\nD2!\n\n"\
"C\nk\nInsert in Buffer\nD1:\nD2!\n\n"\
@@ -1196,6 +1197,20 @@ key_action_handle_command (GtkWidget * w
return 0;
}
+/*
+ * Check if the given session is inside the main window. This predicate
+ * is passed to lastact_pop as a way to filter out detached sessions.
+ * XXX: Consider moving this in a different file?
+ */
+static int
+session_check_is_tab(session *sess)
+{
+ if (!sess || !sess->gui)
+ return FALSE;
+
+ return (sess->gui->is_tab);
+}
+
static int
key_action_page_switch (GtkWidget * wid, GdkEventKey * evt, char *d1,
char *d2, struct session *sess)
@@ -1209,6 +1224,30 @@ key_action_page_switch (GtkWidget * wid,
if (!len)
return 1;
+ if (strcasecmp(d1, "auto") == 0)
+ {
+ /* Auto switch makes no sense in detached sessions */
+ if (!sess->gui->is_tab)
+ return 1;
+
+ /* Obtain a session with recent activity */
+ session *newsess = lastact_getfirst(session_check_is_tab);
+
+ if (newsess)
+ {
+ /*
+ * Only sessions in the current window should be considered (i.e.
+ * we don't want to move the focus on a different window). This
+ * call could, in theory, do this, but we checked before that
+ * newsess->gui->is_tab and sess->gui->is_tab.
+ */
+ mg_bring_tofront_sess(newsess);
+ return 0;
+ }
+ else
+ return 1;
+ }
+
for (i = 0; i < len; i++)
{
if (d1[i] < '0' || d1[i] > '9')
diff -paur xchat2.orig/src/fe-gtk/maingui.c xchat2/src/fe-gtk/maingui.c
--- xchat2.orig/src/fe-gtk/maingui.c 2008-07-20 17:31:44.964469466 +0200
+++ xchat2/src/fe-gtk/maingui.c 2008-07-19 19:58:58.255909127 +0200
@@ -359,6 +359,7 @@ fe_set_tab_color (struct session *sess,
break;
}
+ lastact_update(sess);
}
}
@@ -643,6 +644,7 @@ mg_focus (session *sess)
sess->nick_said = FALSE;
sess->msg_said = FALSE;
sess->new_data = FALSE;
+ lastact_update(sess);
/* when called via mg_changui_new, is_tab might be true, but
sess->res->tab is still NULL. */
if (sess->res->tab)

View file

@ -1,24 +0,0 @@
diff -ur xchat-2.8.6/src/common/servlist.c xchat-2.8.6-default-utf8/src/common/servlist.c
--- xchat-2.8.6/src/common/servlist.c 2008-04-01 10:22:34.000000000 +0200
+++ xchat-2.8.6-default-utf8/src/common/servlist.c 2008-06-15 14:43:35.000000000 +0200
@@ -892,7 +892,7 @@
if (def[i].network)
{
net = servlist_net_add (def[i].network, def[i].host, FALSE);
- net->encoding = strdup ("IRC (Latin/Unicode Hybrid)");
+ net->encoding = strdup ("UTF-8 (Unicode)");
if (def[i].channel)
net->autojoin = strdup (def[i].channel);
if (def[i].charset)
diff -ur xchat-2.8.6/src/fe-gtk/servlistgui.c xchat-2.8.6-default-utf8/src/fe-gtk/servlistgui.c
--- xchat-2.8.6/src/fe-gtk/servlistgui.c 2008-06-08 10:04:48.000000000 +0200
+++ xchat-2.8.6-default-utf8/src/fe-gtk/servlistgui.c 2008-06-15 14:36:03.000000000 +0200
@@ -267,7 +267,7 @@
ircnet *net;
net = servlist_net_add (_("New Network"), "", TRUE);
- net->encoding = strdup ("IRC (Latin/Unicode Hybrid)");
+ net->encoding = strdup ("UTF-8 (Unicode)");
servlist_server_add (net, "newserver/6667");
store = (GtkListStore *)gtk_tree_view_get_model (treeview);

View file

@ -1,35 +0,0 @@
From bc98c28e891408145bed2b18d3c02adbadadde31 Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@src.gnome.org>
Date: Sat, 30 Jan 2010 13:05:21 +0200
Subject: [PATCH] Added port numbers for Freenode
http://freenode.net/irc_servers.shtml
---
src/common/servlist.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/src/common/servlist.c b/src/common/servlist.c
index c6839e0..3082966 100644
--- a/src/common/servlist.c
+++ b/src/common/servlist.c
@@ -207,7 +207,16 @@ static const struct defaultserver def[] =
{0, "irc.vendetta.com"},
{"FreeNode", 0},
- {0, "irc.freenode.net"},
+ {0, "irc.freenode.net/6665"},
+ {0, "irc.freenode.net/6666"},
+ {0, "irc.freenode.net/6667"},
+ {0, "irc.freenode.net/8000"},
+ {0, "irc.freenode.net/8001"},
+ {0, "irc.freenode.net/8002"},
+#ifdef USE_OPENSSL
+ {0, "irc.freenode.net/+7000"},
+ {0, "irc.freenode.net/+7070"},
+#endif
/* {"Freeworld", 0},
{0, "kabel.freeworld.nu"},
--
1.6.6

View file

@ -1,13 +0,0 @@
diff -urNp xchat-2.8.8.orig/xchat.desktop xchat-2.8.8/xchat.desktop
--- xchat-2.8.8.orig/xchat.desktop 2013-06-10 14:01:07.408432973 +0200
+++ xchat-2.8.8/xchat.desktop 2013-06-10 14:12:56.044209785 +0200
@@ -1,7 +1,8 @@
[Desktop Entry]
Encoding=UTF-8
-Name=XChat IRC
+Name=XChat
Name[zh_TW]=網路清談
+GenericName=IRC Client
Comment[de]=IRC-Client
Comment[es]=Aplicación de IRC
Comment[fi]=IRC-sovellus

View file

@ -1,61 +0,0 @@
--- src/common/text.c.orig 2012-02-25 11:05:23.890274334 -0600
+++ src/common/text.c 2012-02-25 11:05:39.006195489 -0600
@@ -28,7 +28,7 @@
#include <sys/mman.h>
#include "xchat.h"
-#include <glib/ghash.h>
+#include <glib.h>
#include "cfgfiles.h"
#include "chanopt.h"
#include "plugin.h"
--- src/common/servlist.c.orig 2012-02-25 11:04:30.601501605 -0600
+++ src/common/servlist.c 2012-02-25 11:04:42.964072823 -0600
@@ -24,7 +24,7 @@
#include <unistd.h>
#include "xchat.h"
-#include <glib/ghash.h>
+#include <glib.h>
#include "cfgfiles.h"
#include "fe.h"
--- src/common/dbus/dbus-client.c.orig 2012-02-25 10:59:23.948527589 -0600
+++ src/common/dbus/dbus-client.c 2012-02-25 11:00:40.082203787 -0600
@@ -53,11 +53,6 @@
GError *error = NULL;
char *command = NULL;
- /* GnomeVFS >=2.15 uses D-Bus and threads, so threads should be
- * initialised before opening for the first time a D-Bus connection */
- if (!g_thread_supported ()) {
- g_thread_init (NULL);
- }
dbus_g_thread_init ();
/* if there is nothing to do, return now. */
--- src/common/xchat.h.orig 2012-02-25 11:29:33.400499630 -0600
+++ src/common/xchat.h 2012-02-25 11:29:51.774834912 -0600
@@ -1,10 +1,6 @@
#include "../../config.h"
-#include <glib/gslist.h>
-#include <glib/glist.h>
-#include <glib/gutils.h>
-#include <glib/giochannel.h>
-#include <glib/gstrfuncs.h>
+#include <glib.h>
#include <time.h> /* need time_t */
#ifndef XCHAT_H
--- src/common/util.c.orig 2012-02-25 11:38:29.404622998 -0600
+++ src/common/util.c 2012-02-25 11:38:51.904482615 -0600
@@ -39,7 +39,7 @@
#include <errno.h>
#include "xchat.h"
#include "xchatc.h"
-#include <glib/gmarkup.h>
+#include <glib.h>
#include <ctype.h>
#include "util.h"
#include "../../config.h"

View file

@ -1,85 +0,0 @@
diff -urNp xchat-2.8.8.orig/configure.in xchat-2.8.8/configure.in
--- xchat-2.8.8.orig/configure.in 2013-06-07 17:33:41.600172433 +0200
+++ xchat-2.8.8/configure.in 2013-06-07 17:39:02.672190284 +0200
@@ -792,6 +792,7 @@ plugins/python/Makefile
plugins/perl/Makefile
plugins/tcl/Makefile
intl/Makefile
+icons/Makefile
po/Makefile.in
])
diff -urNp xchat-2.8.8.orig/icons/Makefile.am xchat-2.8.8/icons/Makefile.am
--- xchat-2.8.8.orig/icons/Makefile.am 1970-01-01 01:00:00.000000000 +0100
+++ xchat-2.8.8/icons/Makefile.am 2013-06-07 17:35:09.053456817 +0200
@@ -0,0 +1,59 @@
+public_icon_themes = \
+ hicolor \
+ $(NULL)
+
+public_icons = \
+ hicolor_apps_16x16_xchat.png \
+ hicolor_apps_22x22_xchat.png \
+ hicolor_apps_24x24_xchat.png \
+ hicolor_apps_32x32_xchat.png \
+ hicolor_apps_48x48_xchat.png \
+ hicolor_apps_256x256_xchat.png \
+ $(NULL)
+
+noinst_DATA = \
+ xchat.svg \
+ $(NULL)
+
+EXTRA_DIST = \
+ $(public_icons) \
+ $(noinst_DATA) \
+ $(NULL)
+
+gtk_update_icon_cache = gtk-update-icon-cache -f -t
+
+update-icon-cache:
+ @-if test -z "$(DESTDIR)"; then \
+ echo "Updating Gtk icon cache."; \
+ for theme in $(public_icon_themes); do \
+ $(gtk_update_icon_cache) $(datadir)/icons/$$theme; \
+ done; \
+ else \
+ echo "*** Icon cache not updated. After (un)install, run this:"; \
+ for theme in $(public_icon_themes); do \
+ echo "*** $(gtk_update_icon_cache) $(datadir)/icons/$$theme"; \
+ done; \
+ fi
+
+install-icons:
+ for icon in $(public_icons); do \
+ THEME=`echo $$icon | cut -d_ -f1`; \
+ CONTEXT=`echo $$icon | cut -d_ -f2`; \
+ SIZE=`echo $$icon | cut -d_ -f3`; \
+ ICONFILE=`echo $$icon | cut -d_ -f4`; \
+ mkdir -p $(DESTDIR)$(datadir)/icons/$$THEME/$$SIZE/$$CONTEXT; \
+ $(INSTALL_DATA) $(srcdir)/$$icon $(DESTDIR)$(datadir)/icons/$$THEME/$$SIZE/$$CONTEXT/$$ICONFILE; \
+ done
+
+uninstall-icons:
+ -for icon in $(public_icons); do \
+ THEME=`echo $$icon | cut -d_ -f1`; \
+ CONTEXT=`echo $$icon | cut -d_ -f2`; \
+ SIZE=`echo $$icon | cut -d_ -f3`; \
+ ICONFILE=`echo $$icon | cut -d_ -f4`; \
+ rm -f $(DESTDIR)$(datadir)/icons/$$THEME/$$SIZE/$$CONTEXT/$$ICONFILE; \
+ done
+
+install-data-local: install-icons update-icon-cache
+
+uninstall-local: uninstall-icons update-icon-cache
diff -urNp xchat-2.8.8.orig/Makefile.am xchat-2.8.8/Makefile.am
--- xchat-2.8.8.orig/Makefile.am 2013-06-07 17:33:41.600172433 +0200
+++ xchat-2.8.8/Makefile.am 2013-06-10 13:25:06.316773350 +0200
@@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in
-SUBDIRS = po intl src plugins
+SUBDIRS = po icons intl src plugins
EXTRA_DIST = autogen.sh HACKING INSTALL.w32 faq.html xchat.png \
xchat.desktop xchat.spec config.h.w32 xchat.ico

View file

@ -1,24 +0,0 @@
diff -up xchat-2.8.8/src/fe-gtk/plugin-tray.c.libnotify07 xchat-2.8.8/src/fe-gtk/plugin-tray.c
--- xchat-2.8.8/src/fe-gtk/plugin-tray.c.libnotify07 2010-11-15 17:32:15.708325783 -0500
+++ xchat-2.8.8/src/fe-gtk/plugin-tray.c 2010-11-15 18:05:17.322141789 -0500
@@ -125,8 +125,9 @@ static void *nn_mod = NULL;
/* prototypes */
static gboolean (*nn_init) (char *);
static void (*nn_uninit) (void);
-static void *(*nn_new_with_status_icon) (const gchar *summary, const gchar *message, const gchar *icon, GtkStatusIcon *status_icon);
-static void *(*nn_new) (const gchar *summary, const gchar *message, const gchar *icon, GtkWidget *attach);
+/* recent versions of libnotify don't take the fourth GtkWidget argument, but passing an
+ * extra NULL argument will be fine */
+static void *(*nn_new) (const gchar *summary, const gchar *message, const gchar *icon, gpointer dummy);
static gboolean (*nn_show) (void *noti, GError **error);
static void (*nn_set_timeout) (void *noti, gint timeout);
@@ -160,8 +161,6 @@ libnotify_notify_new (const char *title,
goto bad;
if (!g_module_symbol (nn_mod, "notify_uninit", (gpointer)&nn_uninit))
goto bad;
- if (!g_module_symbol (nn_mod, "notify_notification_new_with_status_icon", (gpointer)&nn_new_with_status_icon))
- goto bad;
if (!g_module_symbol (nn_mod, "notify_notification_new", (gpointer)&nn_new))
goto bad;
if (!g_module_symbol (nn_mod, "notify_notification_show", (gpointer)&nn_show))

View file

@ -1,343 +0,0 @@
From: Christopher Aillon <caillon@redhat.com>
Date: Thu, 7 Apr 2011 19:34:14 -0700
Subject: [PATCH] Link directly against libnotify
Dynamically loading the library isn't ideal since the soname
can change silently on us. Additionally, notify-send is
shipped as part of libnotify, so we aren't actually bringing
in a new dependency. Since we'd need to patch the source and
rebuild for new sonames anyway, there's little benefit to
dynamically loading libnotify.
Plus, this has the benefit of cleaning up the code, as well as
ensuring we'll catch any future soname changes sooner.
https://bugzilla.redhat.com/show_bug.cgi?id=693362
https://sourceforge.net/tracker/?func=detail&aid=3280223&group_id=239&atid=100239
---
configure.in | 23 +++++++
src/fe-gtk/plugin-tray.c | 144 ++++++++++-------------------------------------
2 files changed, 55 insertions(+), 112 deletions(-)
diff -p -U8 xchat-2.8.8/configure.in.libnotifyso4 xchat-2.8.8/configure.in
--- xchat-2.8.8/configure.in.libnotifyso4 2010-05-29 23:01:16.000000000 -0700
+++ xchat-2.8.8/configure.in 2011-04-07 19:27:00.448137113 -0700
@@ -34,16 +34,17 @@ AH_VERBATIM([PREFIX],[#undef PREFIX])
AH_VERBATIM([XCHATLIBDIR],[#undef XCHATLIBDIR])
AH_VERBATIM([XCHATSHAREDIR],[#undef XCHATSHAREDIR])
AH_VERBATIM([SOCKS],[#undef SOCKS])
AH_VERBATIM([USE_MSPROXY],[#undef USE_MSPROXY])
dnl AH_VERBATIM([USE_GNOME],[#undef USE_GNOME])
AH_VERBATIM([USE_SHM],[#undef USE_SHM])
AH_VERBATIM([USE_GTKSPELL],[#undef USE_GTKSPELL])
AH_VERBATIM([USE_LIBSEXY],[#undef USE_LIBSEXY])
+AH_VERBATIM([USE_LIBNOTIFY],[#undef USE_LIBNOTIFY])
AH_VERBATIM([USE_IPV6],[#undef USE_IPV6])
AH_VERBATIM([USE_MMX],[#undef USE_MMX])
AH_VERBATIM([USE_OPENSSL],[#undef USE_OPENSSL])
AH_VERBATIM([USE_PLUGIN],[#undef USE_PLUGIN])
AH_VERBATIM([USE_XFT],[#undef USE_XFT])
AH_VERBATIM([USE_XLIB],[#undef USE_XLIB])
AH_VERBATIM([USE_SIGACTION],[#undef USE_SIGACTION])
AH_VERBATIM([USING_FREEBSD],[#undef USING_FREEBSD])
@@ -126,16 +127,20 @@ AC_ARG_ENABLE(tcl,
AC_ARG_ENABLE(plugin,
[ --disable-plugin disable plugin support],
plugin=$enableval, plugin=yes)
AC_ARG_ENABLE(dbus,
[ --disable-dbus disable DBUS support],
dbus=$enableval, dbus=yes)
+AC_ARG_ENABLE(libnotify,
+[ --disable-libnotify disable libnotify support],
+ libnotify=$enableval, libnotify=yes)
+
AC_ARG_ENABLE(mmx,
[ --disable-mmx disable MMX assembly routines],
mmx=$enableval, mmx=yes)
AC_ARG_ENABLE(shm,
[ --enable-shm enable use of XShm for fast tinting (default: no)],
shm=$enableval, shm=no)
@@ -482,16 +487,32 @@ if test "x$dbus" = "xyes" ; then
DBUS_SERVICES_DIR="$DATADIR/dbus-1/services"
AC_SUBST(DBUS_SERVICES_DIR)
AC_DEFINE_UNQUOTED(DBUS_SERVICES_DIR, "$DBUS_SERVICES_DIR", [Where services dir for DBUS is])
fi
fi
dnl *********************************************************************
+dnl ** LIBNOTIFY ********************************************************
+dnl *********************************************************************
+
+if test "x$libnotify" = "xyes" ; then
+ PKG_CHECK_MODULES(LIBNOTIFY, libnotify >= 0.4, [], [
+ AC_MSG_RESULT(no)
+ libnotify=no
+ ])
+ if test "$libnotify" != "no" ; then
+ GUI_LIBS="$GUI_LIBS $LIBNOTIFY_LIBS"
+ GUI_CFLAGS="$GUI_CFLAGS $LIBNOTIFY_CFLAGS"
+ AC_DEFINE(USE_LIBNOTIFY)
+ fi
+fi
+
+dnl *********************************************************************
dnl ** SPELL ************************************************************
dnl *********************************************************************
if test "$spell" = "gtkspell" ; then
PKG_CHECK_MODULES(GTKSPELL, gtkspell-2.0 >= 2.0.2, [], [
AC_MSG_RESULT(no)
spell=no
])
@@ -519,16 +540,17 @@ if test "$spell" = "static" ; then
fi
dnl *********************************************************************
dnl ** CONDITIONALS *****************************************************
dnl *********************************************************************
AM_CONDITIONAL(USE_OPENSSL, test "x$openssl" = "xyes")
AM_CONDITIONAL(USE_LIBSEXY, test "x$spell" = "xstatic")
+AM_CONDITIONAL(USE_LIBNOTIFY, test "x$libnotify" = "xyes")
AM_CONDITIONAL(DO_TEXT, test "x$textfe" = "xyes")
AM_CONDITIONAL(DO_GTK, test "x$gtkfe" = "xyes")
AM_CONDITIONAL(DO_PERL, test "x$perl" = "xyes")
AM_CONDITIONAL(DO_PYTHON, test "x$python" = "xyes")
AM_CONDITIONAL(DO_TCL, test "x$tcl" = "xyes")
AM_CONDITIONAL(DO_PLUGIN, test "x$plugin" = "xyes")
AM_CONDITIONAL(USE_DBUS, test "x$dbus" = "xyes")
AM_CONDITIONAL(DO_GCONF, test "x$GCONFTOOL" != "xno")
@@ -807,16 +829,17 @@ echo mmx tinting ......... : $mmx\ spell
echo XShm tinting ........ : $shm\ plugin interface ...... : $plugin
if test "$xft" = no; then
echo text backend ........ : pango\ nls/gettext ........... : $USE_NLS
else
echo text backend ........ : xft\ nls/gettext ........... : $USE_NLS
fi
echo openssl support ..... : $openssl\ ipv6 support .......... : $ipv6
echo dbus support ........ : $dbus\ msproxy ntlm \(ISA\) .... : $have_ntlm
+echo libnotify support ... : $libnotify
echo
echo The binary will be installed in $prefix/bin
echo
if test "$gtkfe" = no; then
echo Warning: The GTK \(GUI\) frontend will not be built.
echo
fi
diff -p -U8 xchat-2.8.8/src/fe-gtk/plugin-tray.c.libnotifyso4 xchat-2.8.8/src/fe-gtk/plugin-tray.c
--- xchat-2.8.8/src/fe-gtk/plugin-tray.c.libnotifyso4 2011-04-07 17:57:27.524307905 -0700
+++ xchat-2.8.8/src/fe-gtk/plugin-tray.c 2011-04-07 19:18:33.429475719 -0700
@@ -10,17 +10,27 @@
#include "../common/fe.h"
#include "../common/util.h"
#include "fe-gtk.h"
#include "pixmaps.h"
#include "maingui.h"
#include "menu.h"
#include <gtk/gtk.h>
-#define LIBNOTIFY
+#ifdef USE_LIBNOTIFY
+#include <libnotify/notify.h>
+#ifndef NOTIFY_CHECK_VERSION
+#define NOTIFY_CHECK_VERSION(x,y,z) 0
+#endif
+#if NOTIFY_CHECK_VERSION(0,7,0)
+#define XC_NOTIFY_NEW(a,b,c,d) notify_notification_new(a,b,c)
+#else
+#define XC_NOTIFY_NEW(a,b,c,d) notify_notification_new(a,b,c,d)
+#endif
+#endif
typedef enum /* current icon status */
{
TS_NONE,
TS_MESSAGE,
TS_HIGHLIGHT,
TS_FILEOFFER,
TS_CUSTOM /* plugin */
@@ -112,90 +122,16 @@ tray_count_networks (void)
void
fe_tray_set_tooltip (const char *text)
{
if (sticon)
gtk_status_icon_set_tooltip (sticon, text);
}
-#ifdef LIBNOTIFY
-
-/* dynamic access to libnotify.so */
-
-static void *nn_mod = NULL;
-/* prototypes */
-static gboolean (*nn_init) (char *);
-static void (*nn_uninit) (void);
-/* recent versions of libnotify don't take the fourth GtkWidget argument, but passing an
- * extra NULL argument will be fine */
-static void *(*nn_new) (const gchar *summary, const gchar *message, const gchar *icon, gpointer dummy);
-static gboolean (*nn_show) (void *noti, GError **error);
-static void (*nn_set_timeout) (void *noti, gint timeout);
-
-static void
-libnotify_cleanup (void)
-{
- if (nn_mod)
- {
- nn_uninit ();
- g_module_close (nn_mod);
- nn_mod = NULL;
- }
-}
-
-static gboolean
-libnotify_notify_new (const char *title, const char *text, GtkStatusIcon *icon)
-{
- void *noti;
-
- if (!nn_mod)
- {
- nn_mod = g_module_open ("libnotify", G_MODULE_BIND_LAZY);
- if (!nn_mod)
- {
- nn_mod = g_module_open ("libnotify.so.1", G_MODULE_BIND_LAZY);
- if (!nn_mod)
- return FALSE;
- }
-
- if (!g_module_symbol (nn_mod, "notify_init", (gpointer)&nn_init))
- goto bad;
- if (!g_module_symbol (nn_mod, "notify_uninit", (gpointer)&nn_uninit))
- goto bad;
- if (!g_module_symbol (nn_mod, "notify_notification_new", (gpointer)&nn_new))
- goto bad;
- if (!g_module_symbol (nn_mod, "notify_notification_show", (gpointer)&nn_show))
- goto bad;
- if (!g_module_symbol (nn_mod, "notify_notification_set_timeout", (gpointer)&nn_set_timeout))
- goto bad;
- if (!nn_init (PACKAGE_NAME))
- goto bad;
- }
-
- text = strip_color (text, -1, STRIP_ALL|STRIP_ESCMARKUP);
- title = strip_color (title, -1, STRIP_ALL);
- noti = nn_new (title, text, XCHATSHAREDIR"/pixmaps/xchat.png", NULL);
- g_free ((char *)title);
- g_free ((char *)text);
-
- nn_set_timeout (noti, prefs.input_balloon_time*1000);
- nn_show (noti, NULL);
- g_object_unref (G_OBJECT (noti));
-
- return TRUE;
-
-bad:
- g_module_close (nn_mod);
- nn_mod = NULL;
- return FALSE;
-}
-
-#endif
-
void
fe_tray_set_balloon (const char *title, const char *text)
{
#ifndef WIN32
const char *argv[8];
const char *path;
char time[16];
WinStatus ws;
@@ -208,52 +144,36 @@ fe_tray_set_balloon (const char *title,
/* bit 1 of flags means "no balloons unless hidden/iconified" */
if (ws != WS_HIDDEN && (prefs.gui_tray_flags & 2))
return;
/* FIXME: this should close the current balloon */
if (!text)
return;
-#ifdef LIBNOTIFY
- /* try it via libnotify.so */
- if (libnotify_notify_new (title, text, sticon))
- return; /* success */
-#endif
+#ifdef USE_LIBNOTIFY
+ NotifyNotification *notification;
+ char *notify_text, *notify_title;
- /* try it the crude way */
- path = g_find_program_in_path ("notify-send");
- if (path)
- {
- sprintf(time, "%d000",prefs.input_balloon_time);
- argv[0] = path;
- argv[1] = "-i";
- argv[2] = "gtk-dialog-info";
- if (access (XCHATSHAREDIR"/pixmaps/xchat.png", R_OK) == 0)
- argv[2] = XCHATSHAREDIR"/pixmaps/xchat.png";
- argv[3] = "-t";
- argv[4] = time;
- argv[5] = title;
- text = strip_color (text, -1, STRIP_ALL|STRIP_ESCMARKUP);
- argv[6] = text;
- argv[7] = NULL;
- xchat_execv (argv);
- g_free ((char *)path);
- g_free ((char *)text);
- }
- else
- {
- /* show this error only once */
- static unsigned char said_it = FALSE;
- if (!said_it)
- {
- said_it = TRUE;
- fe_message (_("Cannot find 'notify-send' to open balloon alerts.\nPlease install libnotify."), FE_MSG_ERROR);
- }
- }
+ if (!notify_is_initted())
+ notify_init(PACKAGE_NAME);
+
+ notify_text = strip_color (text, -1, STRIP_ALL|STRIP_ESCMARKUP);
+ notify_title = strip_color (title, -1, STRIP_ALL);
+
+ notification = XC_NOTIFY_NEW (notify_title, notify_text, XCHATSHAREDIR"/pixmaps/xchat.png", NULL);
+
+ g_free ((char *)notify_title);
+ g_free ((char *)notify_text);
+
+ notify_notification_set_timeout (notification, prefs.input_balloon_time*1000);
+ notify_notification_show (notification, NULL);
+
+ g_object_unref (notification);
+#endif
#endif
}
static void
tray_set_balloonf (const char *text, const char *format, ...)
{
va_list args;
char *buf;
@@ -840,13 +760,13 @@ tray_plugin_init (xchat_plugin *plugin_h
return 1; /* return 1 for success */
}
int
tray_plugin_deinit (xchat_plugin *plugin_handle)
{
#ifdef WIN32
tray_cleanup ();
-#elif defined(LIBNOTIFY)
- libnotify_cleanup ();
+#elif defined(USE_LIBNOTIFY)
+ notify_uninit ();
#endif
return 1;
}

View file

@ -1,30 +0,0 @@
diff -urNp xchat-2.8.8/src/common/cfgfiles.c xchat-2.8.8-notifications-and-tray/src/common/cfgfiles.c
--- xchat-2.8.8/src/common/cfgfiles.c 2009-08-16 11:40:16.000000000 +0200
+++ xchat-2.8.8-notifications-and-tray/src/common/cfgfiles.c 2012-11-27 15:34:13.080403744 +0100
@@ -670,11 +670,13 @@ load_config (void)
prefs.autoopendccchatwindow = 1;
prefs.userhost = 1;
prefs.gui_url_mod = 4; /* ctrl */
- prefs.gui_tray = 1;
+ prefs.gui_tray = 0;
prefs.gui_pane_left_size = 100;
prefs.gui_pane_right_size = 100;
prefs.mainwindow_save = 1;
prefs.bantype = 2;
+ prefs.input_balloon_hilight = 1;
+ prefs.input_balloon_priv = 1;
prefs.input_balloon_time = 20;
prefs.input_flash_priv = prefs.input_flash_hilight = 1;
prefs.input_tray_priv = prefs.input_tray_hilight = 1;
diff -urNp xchat-2.8.8/src/fe-gtk/maingui.c xchat-2.8.8-notifications-and-tray/src/fe-gtk/maingui.c
--- xchat-2.8.8/src/fe-gtk/maingui.c 2010-05-16 05:15:55.000000000 +0200
+++ xchat-2.8.8-notifications-and-tray/src/fe-gtk/maingui.c 2012-11-27 16:05:27.609518192 +0100
@@ -3107,7 +3107,7 @@ mg_tabwindow_de_cb (GtkWidget *widget, G
list = list->next;
}
- mg_open_quit_dialog (TRUE);
+ mg_open_quit_dialog (FALSE);
return TRUE;
}

File diff suppressed because it is too large Load diff

1007
xchat.spec

File diff suppressed because it is too large Load diff

1802
xchat.svg

File diff suppressed because it is too large Load diff

Before

Width:  |  Height:  |  Size: 74 KiB