diff src/themes.c @ 4667:4bf9c6e8e432

[gaim-migrate @ 4978] protocol-specific smileys in the smiley dialog committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Fri, 07 Mar 2003 23:49:10 +0000
parents c4ca37f34130
children 677d3cb193a1
line wrap: on
line diff
--- a/src/themes.c	Fri Mar 07 18:49:59 2003 +0000
+++ b/src/themes.c	Fri Mar 07 23:49:10 2003 +0000
@@ -22,11 +22,11 @@
 #include "gaim.h"
 #include "ui.h"
 #include "gtkimhtml.h"
+#include "prpl.h"
 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>
 #include <sys/stat.h>
-#include "gaim.h"
 
 #ifdef _WIN32
 #include "win32dep.h"
@@ -149,7 +149,7 @@
 			theme->author = g_strdup(i + strlen("Author="));
 			theme->author[strlen(theme->author)-1] = 0;
 		} else if (load && list) {
-			gboolean hidden;
+			gboolean hidden = FALSE;
 			char *sfile = NULL;
 
 			if (*i == '!' && *(i + 1) == ' ') {
@@ -169,6 +169,7 @@
 					l[li] = 0;
 					smiley->file = sfile;
 					smiley->smile = g_strdup(l);
+					smiley->hidden = hidden;
 					list->smileys = g_slist_append(list->smileys, smiley);
 				}
 				while (isspace(*i))
@@ -227,3 +228,24 @@
 		g_free(probedirs[l]);
 	}
 }
+
+GSList *get_proto_smileys(int protocol) {
+	struct prpl *proto = find_prpl(protocol);
+	struct smiley_list *list, *def;
+
+	if(!current_smiley_theme)
+		return NULL;
+
+	def = list = current_smiley_theme->list;
+
+	while(list) {
+		if(!strcmp(list->sml, "default"))
+			def = list;
+		else if(proto && !strcmp(proto->name, list->sml))
+			break;
+
+		list = list->next;
+	}
+
+	return list ? list->smileys : def->smileys;
+}