summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWouter Coekaerts <coekie@irssi.org>2006-08-20 13:07:54 +0000
committercoekie <coekie@dbcabf3a-b0e7-0310-adc4-f8d773084564>2006-08-20 13:07:54 +0000
commitdee4238e9b4d2d28f243d41628a66e53de4010bb (patch)
treecf1d2172594487a976c3f02d04c220c711744f8a /src
parent8b75299729034bd130e06462ebac49158bf58160 (diff)
downloadirssi-dee4238e9b4d2d28f243d41628a66e53de4010bb.zip
compile with glib1 again
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4320 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r--src/core/nicklist.c8
-rw-r--r--src/core/nicklist.h3
-rw-r--r--src/fe-common/core/fe-channels.c5
3 files changed, 16 insertions, 0 deletions
diff --git a/src/core/nicklist.c b/src/core/nicklist.c
index 73143644..4f322bf5 100644
--- a/src/core/nicklist.c
+++ b/src/core/nicklist.c
@@ -356,6 +356,14 @@ GSList *nicklist_get_same_unique(SERVER_REC *server, void *id)
return rec.list;
}
+#if GLIB_MAJOR_VERSION < 2
+/* glib1 doesn't have g_slist_sort_with_data, so non-standard prefixes won't be sorted correctly */
+int nicklist_compare_glib1(NICK_REC *p1, NICK_REC *p2)
+{
+ return nicklist_compare(p1, p2, NULL);
+}
+#endif
+
/* nick record comparision for sort functions */
int nicklist_compare(NICK_REC *p1, NICK_REC *p2, const char *nick_prefix)
{
diff --git a/src/core/nicklist.h b/src/core/nicklist.h
index 38c547a5..78dabcc0 100644
--- a/src/core/nicklist.h
+++ b/src/core/nicklist.h
@@ -49,6 +49,9 @@ void nicklist_update_flags_unique(SERVER_REC *server, void *id,
void nicklist_set_own(CHANNEL_REC *channel, NICK_REC *nick);
/* Nick record comparision for sort functions */
+#if GLIB_MAJOR_VERSION < 2
+int nicklist_compare_glib1(NICK_REC *p1, NICK_REC *p2);
+#endif
int nicklist_compare(NICK_REC *p1, NICK_REC *p2, const char *nick_prefix);
/* Check is `msg' is meant for `nick'. */
diff --git a/src/fe-common/core/fe-channels.c b/src/fe-common/core/fe-channels.c
index 9bc51f37..6579e8b2 100644
--- a/src/fe-common/core/fe-channels.c
+++ b/src/fe-common/core/fe-channels.c
@@ -508,7 +508,12 @@ void fe_channels_nicklist(CHANNEL_REC *channel, int flags)
g_slist_free(nicklist);
/* sort the nicklist */
+#if GLIB_MAJOR_VERSION < 2
+ /* glib1 doesn't have g_slist_sort_with_data, so non-standard prefixes won't be sorted correctly */
+ sorted = g_slist_sort(sorted, (GCompareFunc)nicklist_compare_glib1);
+#else
sorted = g_slist_sort_with_data(sorted, (GCompareDataFunc) nicklist_compare, (void *)nick_flags);
+#endif
/* display the nicks */
if ((flags & CHANNEL_NICKLIST_FLAG_COUNT) == 0) {