Mercurial > pidgin-twitter
changeset 38:625e385036c3
applied indent to fix indentations
author | Yoshiki Yazawa <yaz@cc.rim.or.jp> |
---|---|
date | Mon, 12 May 2008 19:46:10 +0900 |
parents | bafe2abf2d3b |
children | 2ac81c0afb53 |
files | pidgin-twitter.c |
diffstat | 1 files changed, 159 insertions(+), 168 deletions(-) [+] |
line wrap: on
line diff
--- a/pidgin-twitter.c Sun May 11 15:24:53 2008 +0900 +++ b/pidgin-twitter.c Mon May 12 19:46:10 2008 +0900 @@ -35,7 +35,7 @@ #define SENDER 1 #define COMMAND 2 #define PSEUDO 3 -#define SENDER_WITH_LINK 4 +#define SENDER_WITH_LINK 4 #define PLUGIN_ID "gtk-honeyplanet-pidgin_twitter" #define PLUGIN_NAME "pidgin-twitter" @@ -77,7 +77,8 @@ gchar *newstr = NULL; /* replace senders with link */ - newstr = g_regex_replace(regp[SENDER_WITH_LINK], *str, -1, 0, "@\\1", 0, NULL); + newstr = + g_regex_replace(regp[SENDER_WITH_LINK], *str, -1, 0, "@\\1", 0, NULL); twitter_debug("*str = %s\n", *str); twitter_debug("rnewstr = %s\n", newstr); @@ -132,7 +133,7 @@ } static gboolean -sending_im_cb(PurpleAccount * account, char *recipient, char **buffer, +sending_im_cb(PurpleAccount *account, char *recipient, char **buffer, void *data) { const gchar *proto; @@ -154,7 +155,7 @@ /* try to suppress Oops message */ gint utflen = g_utf8_strlen(*buffer, -1); - gint bytes = strlen(*buffer); + gint bytes = strlen(*buffer); twitter_debug("utflen = %d bytes = %d\n", utflen, bytes); if(bytes > 140 && utflen <= 140) suppress_oops = TRUE; @@ -163,7 +164,7 @@ } static gboolean -eval(const GMatchInfo * match_info, GString * result, gpointer user_data) +eval(const GMatchInfo *match_info, GString *result, gpointer user_data) { gchar sub[128]; gchar *match = g_match_info_fetch(match_info, 1); @@ -186,11 +187,11 @@ twitter_debug("*str = %s\n", *str); newstr = g_regex_replace_eval(regp[which], // compiled regex - *str, // subject string - -1, // length of the subject string - 0, // start position - 0, // match options - eval, // function to be called for each match + *str, // subject string + -1, // length of the subject string + 0, // start position + 0, // match options + eval, // function to be called for each match &which, // user data NULL); // error handler @@ -221,14 +222,15 @@ gchar *user = g_match_info_fetch(match_info, 1); twitter_debug("user = %s\n", user); - for(candidate = candidates; *candidate ; candidate++) { + for(candidate = candidates; *candidate; candidate++) { if(!strcmp(*candidate, "")) continue; twitter_debug("candidate = %s\n", *candidate); if(!strcmp(user, *candidate)) { twitter_debug("match. play sound\n"); - purple_sound_play_event( - purple_prefs_get_int(which ? OPT_SOUNDID_SENDER : OPT_SOUNDID_RECIPIENT), NULL); + purple_sound_play_event(purple_prefs_get_int + (which ? OPT_SOUNDID_SENDER : + OPT_SOUNDID_RECIPIENT), NULL); break; } } @@ -240,8 +242,8 @@ } static gboolean -writing_im_cb(PurpleAccount * account, char *sender, char **buffer, - PurpleConversation * conv, int *flags, void *data) +writing_im_cb(PurpleAccount *account, char *sender, char **buffer, + PurpleConversation *conv, int *flags, void *data) { const gchar *proto; @@ -251,8 +253,7 @@ twitter_debug("proto = %s\n", proto); twitter_debug("sender = %s\n", sender); - if(!strcmp(sender, "twitter@twitter.com") && - !strcmp(proto, "prpl-jabber")) { + if(!strcmp(sender, "twitter@twitter.com") && !strcmp(proto, "prpl-jabber")) { /* playsound */ if(purple_prefs_get_bool(OPT_PLAYSOUND_SENDER)) { playsound(buffer, SENDER); @@ -281,11 +282,11 @@ insert_text_cb(GtkTextBuffer *textbuffer, GtkTextIter *position, gchar *new_text, gint new_text_length, gpointer user_data) { - PidginConversation *gtkconv = (PidginConversation *)user_data; - GtkWidget *box, *counter = NULL; - gchar *markup = NULL; + PidginConversation *gtkconv = (PidginConversation *)user_data; + GtkWidget *box, *counter = NULL; + gchar *markup = NULL; - g_return_if_fail(gtkconv != NULL); + g_return_if_fail(gtkconv != NULL); guint count = gtk_text_buffer_get_char_count(textbuffer) + (unsigned int)g_utf8_strlen(new_text, -1); @@ -294,13 +295,11 @@ // new_text, g_utf8_strlen(new_text, -1), new_text_length); markup = g_markup_printf_escaped("<span color=\"%s\">%u</span>", - count <= 140 ? "black" : "red", - count); + count <= 140 ? "black" : "red", count); - box = gtkconv->toolbar; - counter = g_object_get_data(G_OBJECT(box), - PLUGIN_ID "-counter"); - if (counter) + box = gtkconv->toolbar; + counter = g_object_get_data(G_OBJECT(box), PLUGIN_ID "-counter"); + if(counter) gtk_label_set_markup(GTK_LABEL(counter), markup); g_free(markup); @@ -310,24 +309,22 @@ delete_text_cb(GtkTextBuffer *textbuffer, GtkTextIter *start_pos, GtkTextIter *end_pos, gpointer user_data) { - PidginConversation *gtkconv = (PidginConversation *)user_data; - GtkWidget *box, *counter = NULL; - gchar *markup = NULL; + PidginConversation *gtkconv = (PidginConversation *)user_data; + GtkWidget *box, *counter = NULL; + gchar *markup = NULL; - g_return_if_fail(gtkconv != NULL); + g_return_if_fail(gtkconv != NULL); guint count = gtk_text_buffer_get_char_count(textbuffer) - - (gtk_text_iter_get_offset(end_pos) - - gtk_text_iter_get_offset(start_pos)); + (gtk_text_iter_get_offset(end_pos) - + gtk_text_iter_get_offset(start_pos)); markup = g_markup_printf_escaped("<span color=\"%s\">%u</span>", - count <= 140 ? "black" : "red", - count); + count <= 140 ? "black" : "red", count); - box = gtkconv->toolbar; - counter = g_object_get_data(G_OBJECT(box), - PLUGIN_ID "-counter"); - if (counter) + box = gtkconv->toolbar; + counter = g_object_get_data(G_OBJECT(box), PLUGIN_ID "-counter"); + if(counter) gtk_label_set_markup(GTK_LABEL(counter), markup); g_free(markup); @@ -339,46 +336,44 @@ { GList *list; - for (list = pidgin_conv_windows_get_list(); list; list = list->next) { - PidginWindow *win = list->data; - PurpleConversation *conv = pidgin_conv_window_get_active_conversation(win); + for(list = pidgin_conv_windows_get_list(); list; list = list->next) { + PidginWindow *win = list->data; + PurpleConversation *conv = + pidgin_conv_window_get_active_conversation(win); if(is_twitter_conv(conv)) detach_from_gtkconv(PIDGIN_CONVERSATION(conv), NULL); - } + } } static void detach_from_gtkconv(PidginConversation *gtkconv, gpointer null) { - GtkWidget *box, *counter = NULL, *sep = NULL; + GtkWidget *box, *counter = NULL, *sep = NULL; - g_signal_handlers_disconnect_by_func(G_OBJECT(gtkconv->entry_buffer), - (GFunc)insert_text_cb, gtkconv); - g_signal_handlers_disconnect_by_func(G_OBJECT(gtkconv->entry_buffer), - (GFunc)delete_text_cb, gtkconv); + g_signal_handlers_disconnect_by_func(G_OBJECT(gtkconv->entry_buffer), + (GFunc) insert_text_cb, gtkconv); + g_signal_handlers_disconnect_by_func(G_OBJECT(gtkconv->entry_buffer), + (GFunc) delete_text_cb, gtkconv); - box = gtkconv->toolbar; + box = gtkconv->toolbar; /* remove counter */ - counter = g_object_get_data(G_OBJECT(box), - PLUGIN_ID "-counter"); - if (counter) { - gtk_container_remove(GTK_CONTAINER(box), counter); + counter = g_object_get_data(G_OBJECT(box), PLUGIN_ID "-counter"); + if(counter) { + gtk_container_remove(GTK_CONTAINER(box), counter); g_object_unref(counter); - g_object_set_data(G_OBJECT(box), - PLUGIN_ID "-counter", NULL); + g_object_set_data(G_OBJECT(box), PLUGIN_ID "-counter", NULL); } /* remove separator */ - sep = g_object_get_data(G_OBJECT(box), PLUGIN_ID "-sep"); - if (sep) { - gtk_container_remove(GTK_CONTAINER(box), sep); + sep = g_object_get_data(G_OBJECT(box), PLUGIN_ID "-sep"); + if(sep) { + gtk_container_remove(GTK_CONTAINER(box), sep); g_object_unref(sep); - g_object_set_data(G_OBJECT(box), - PLUGIN_ID "-sep", NULL); + g_object_set_data(G_OBJECT(box), PLUGIN_ID "-sep", NULL); } - gtk_widget_queue_draw(pidgin_conv_get_window(gtkconv)->window); + gtk_widget_queue_draw(pidgin_conv_get_window(gtkconv)->window); } static void @@ -386,48 +381,46 @@ { GList *list; - for (list = pidgin_conv_windows_get_list(); list; list = list->next) { - PidginWindow *win = list->data; - PurpleConversation *conv = pidgin_conv_window_get_active_conversation(win); + for(list = pidgin_conv_windows_get_list(); list; list = list->next) { + PidginWindow *win = list->data; + PurpleConversation *conv = + pidgin_conv_window_get_active_conversation(win); if(is_twitter_conv(conv)) attach_to_gtkconv(PIDGIN_CONVERSATION(conv), NULL); - } + } } static void attach_to_gtkconv(PidginConversation *gtkconv, gpointer null) { - GtkWidget *box, *sep, *counter; + GtkWidget *box, *sep, *counter; - box = gtkconv->toolbar; - counter = g_object_get_data(G_OBJECT(box), - PLUGIN_ID "-counter"); - g_return_if_fail(counter == NULL); + box = gtkconv->toolbar; + counter = g_object_get_data(G_OBJECT(box), PLUGIN_ID "-counter"); + g_return_if_fail(counter == NULL); /* make counter object */ - counter = gtk_label_new(NULL); - gtk_widget_set_name(counter, "counter_label"); - gtk_label_set_text(GTK_LABEL(counter), "0"); - gtk_box_pack_end(GTK_BOX(box), counter, FALSE, FALSE, 0); - gtk_widget_show_all(counter); - g_object_set_data(G_OBJECT(box), - PLUGIN_ID "-counter", counter); + counter = gtk_label_new(NULL); + gtk_widget_set_name(counter, "counter_label"); + gtk_label_set_text(GTK_LABEL(counter), "0"); + gtk_box_pack_end(GTK_BOX(box), counter, FALSE, FALSE, 0); + gtk_widget_show_all(counter); + g_object_set_data(G_OBJECT(box), PLUGIN_ID "-counter", counter); /* make separator object */ - sep = gtk_vseparator_new(); - gtk_box_pack_end(GTK_BOX(box), sep, FALSE, FALSE, 0); - gtk_widget_show_all(sep); - g_object_set_data(G_OBJECT(box), - PLUGIN_ID "-sep", sep); + sep = gtk_vseparator_new(); + gtk_box_pack_end(GTK_BOX(box), sep, FALSE, FALSE, 0); + gtk_widget_show_all(sep); + g_object_set_data(G_OBJECT(box), PLUGIN_ID "-sep", sep); - /* connect signals, etc. */ - g_signal_connect(G_OBJECT(gtkconv->entry_buffer), "insert_text", - G_CALLBACK(insert_text_cb), gtkconv); - g_signal_connect(G_OBJECT(gtkconv->entry_buffer), "delete_range", - G_CALLBACK(delete_text_cb), gtkconv); + /* connect signals, etc. */ + g_signal_connect(G_OBJECT(gtkconv->entry_buffer), "insert_text", + G_CALLBACK(insert_text_cb), gtkconv); + g_signal_connect(G_OBJECT(gtkconv->entry_buffer), "delete_range", + G_CALLBACK(delete_text_cb), gtkconv); /* redraw window */ - gtk_widget_queue_draw(pidgin_conv_get_window(gtkconv)->window); + gtk_widget_queue_draw(pidgin_conv_get_window(gtkconv)->window); } static gboolean @@ -441,8 +434,7 @@ twitter_debug("name = %s\n", name); twitter_debug("proto = %s\n", proto); - if(!strcmp(name, "twitter@twitter.com") && - !strcmp(proto, "prpl-jabber")) { + if(!strcmp(name, "twitter@twitter.com") && !strcmp(proto, "prpl-jabber")) { return TRUE; } @@ -452,8 +444,8 @@ static void conv_created_cb(PurpleConversation *conv, gpointer null) { - PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv); - g_return_if_fail(gtkconv != NULL); + PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv); + g_return_if_fail(gtkconv != NULL); /* only attach to twitter conversation window */ if(is_twitter_conv(conv)) { @@ -476,22 +468,24 @@ if(strstr(*buffer, OOPS_MESSAGE)) { twitter_debug("receiving_im_cb: clearing sender and buffer\n"); - g_free(*sender); *sender = NULL; - g_free(*buffer); *buffer = NULL; + g_free(*sender); + *sender = NULL; + g_free(*buffer); + *buffer = NULL; suppress_oops = FALSE; } return FALSE; } static gboolean -load_plugin(PurplePlugin * plugin) +load_plugin(PurplePlugin *plugin) { /* connect to signal */ purple_signal_connect(purple_conversations_get_handle(), "writing-im-msg", plugin, PURPLE_CALLBACK(writing_im_cb), NULL); purple_signal_connect(purple_conversations_get_handle(), "sending-im-msg", plugin, PURPLE_CALLBACK(sending_im_cb), NULL); - purple_signal_connect(purple_conversations_get_handle(), + purple_signal_connect(purple_conversations_get_handle(), "conversation-created", plugin, PURPLE_CALLBACK(conv_created_cb), NULL); purple_signal_connect(purple_conversations_get_handle(), "receiving-im-msg", @@ -499,15 +493,18 @@ /* compile regex */ regp[RECIPIENT] = g_regex_new("@([A-Za-z0-9_]+)", 0, 0, NULL); - regp[SENDER] = g_regex_new("<body>([A-Za-z0-9_]+): ", 0, 0, NULL); - regp[COMMAND] = g_regex_new( - "^(?:\\s*)([dDfFgGlLmMnNtTwW]{1}\\s+[A-Za-z0-9_]+\\Z)", - G_REGEX_RAW, 0, NULL); - regp[PSEUDO] = g_regex_new( - "^\\s*(?:[\"#$%&'()*+,\\-./:;<=>?\\[\\\\\\]_`{|}~]|[^\\s\\x21-\\x7E])*([dDfFgGlLmMnNtTwW]{1})(?:\\Z|\\s+|[^\\x21-\\x7E]+\\Z)", - G_REGEX_RAW, 0, NULL); - regp[SENDER_WITH_LINK] = g_regex_new( - "@(?:<font .+?>)?<a href=.+?>([A-Za-z0-9_]+?)</a>(?:</font>)?", 0, 0, NULL); + regp[SENDER] = g_regex_new("<body>([A-Za-z0-9_]+): ", 0, 0, NULL); + regp[COMMAND] = + g_regex_new("^(?:\\s*)([dDfFgGlLmMnNtTwW]{1}\\s+[A-Za-z0-9_]+\\Z)", + G_REGEX_RAW, 0, NULL); + regp[PSEUDO] = + g_regex_new + ("^\\s*(?:[\"#$%&'()*+,\\-./:;<=>?\\[\\\\\\]_`{|}~]|[^\\s\\x21-\\x7E])*([dDfFgGlLmMnNtTwW]{1})(?:\\Z|\\s+|[^\\x21-\\x7E]+\\Z)", + G_REGEX_RAW, 0, NULL); + regp[SENDER_WITH_LINK] = + g_regex_new + ("@(?:<font .+?>)?<a href=.+?>([A-Za-z0-9_]+?)</a>(?:</font>)?", 0, 0, + NULL); /* attach counter to the existing twitter window */ gboolean enabled = purple_prefs_get_bool(OPT_COUNTER); @@ -519,7 +516,7 @@ } static gboolean -unload_plugin(PurplePlugin * plugin) +unload_plugin(PurplePlugin *plugin) { twitter_debug("pidgin-twitter unload called\n"); @@ -530,7 +527,7 @@ purple_signal_disconnect(purple_conversations_get_handle(), "sending-im-msg", plugin, PURPLE_CALLBACK(sending_im_cb)); - purple_signal_disconnect(purple_conversations_get_handle(), + purple_signal_disconnect(purple_conversations_get_handle(), "conversation-created", plugin, PURPLE_CALLBACK(conv_created_cb)); purple_signal_disconnect(purple_conversations_get_handle(), @@ -552,11 +549,11 @@ static void counter_prefs_cb(const char *name, PurplePrefType type, - gconstpointer val, gpointer data) + gconstpointer val, gpointer data) { gboolean enabled = purple_prefs_get_bool(OPT_COUNTER); if(enabled) { - attach_to_window(); //xxx should check whether already attached or not? + attach_to_window(); //xxx should check whether already attached or not? } else { detach_from_window(); @@ -564,7 +561,7 @@ } static PurplePluginPrefFrame * -get_plugin_pref_frame(PurplePlugin * plugin) +get_plugin_pref_frame(PurplePlugin *plugin) { /* create gtk elements for the plugin preferences */ PurplePluginPref *pref; @@ -577,14 +574,12 @@ purple_plugin_pref_frame_add(frame, pref); /* translation settings */ - pref = purple_plugin_pref_new_with_name_and_label( - OPT_TRANSLATE_RECIPIENT, - "Translate @username to link"); + pref = purple_plugin_pref_new_with_name_and_label(OPT_TRANSLATE_RECIPIENT, + "Translate @username to link"); purple_plugin_pref_frame_add(frame, pref); - pref = purple_plugin_pref_new_with_name_and_label( - OPT_TRANSLATE_SENDER, - "Translate sender name to link"); + pref = purple_plugin_pref_new_with_name_and_label(OPT_TRANSLATE_SENDER, + "Translate sender name to link"); purple_plugin_pref_frame_add(frame, pref); @@ -595,24 +590,20 @@ purple_plugin_pref_frame_add(frame, pref); /* escape pseudo command setting */ - pref = purple_plugin_pref_new_with_name_and_label( - OPT_ESCAPE_PSEUDO, - "Escape pseudo command string"); + pref = purple_plugin_pref_new_with_name_and_label(OPT_ESCAPE_PSEUDO, + "Escape pseudo command string"); purple_plugin_pref_frame_add(frame, pref); /* show text counter */ - pref = purple_plugin_pref_new_with_name_and_label( - OPT_COUNTER, - "Show text counter"); + pref = purple_plugin_pref_new_with_name_and_label(OPT_COUNTER, + "Show text counter"); purple_plugin_pref_frame_add(frame, pref); - purple_prefs_connect_callback(plugin, OPT_COUNTER, - counter_prefs_cb, NULL); + purple_prefs_connect_callback(plugin, OPT_COUNTER, counter_prefs_cb, NULL); /* suppress oops message */ - pref = purple_plugin_pref_new_with_name_and_label( - OPT_SUPPRESS_OOPS, - "Suppress oops message"); + pref = purple_plugin_pref_new_with_name_and_label(OPT_SUPPRESS_OOPS, + "Suppress oops message"); purple_plugin_pref_frame_add(frame, pref); @@ -623,64 +614,64 @@ purple_plugin_pref_frame_add(frame, pref); /* sound settings for recipient */ - pref = purple_plugin_pref_new_with_name_and_label( - OPT_PLAYSOUND_RECIPIENT, - "Play sound on a reply to the user in the recipient list"); + pref = purple_plugin_pref_new_with_name_and_label(OPT_PLAYSOUND_RECIPIENT, + "Play sound on a reply to the user in the recipient list"); purple_plugin_pref_frame_add(frame, pref); /* recipient list */ - pref = purple_plugin_pref_new_with_name_and_label( - OPT_USERLIST_RECIPIENT, - "Recipient List"); + pref = purple_plugin_pref_new_with_name_and_label(OPT_USERLIST_RECIPIENT, + "Recipient List"); purple_plugin_pref_frame_add(frame, pref); /* sound id selector */ - pref = purple_plugin_pref_new_with_name_and_label(OPT_SOUNDID_RECIPIENT, "Recipient Sound"); + pref = + purple_plugin_pref_new_with_name_and_label(OPT_SOUNDID_RECIPIENT, + "Recipient Sound"); - purple_plugin_pref_set_type(pref, PURPLE_PLUGIN_PREF_CHOICE); - purple_plugin_pref_add_choice(pref, "Arrive", GINT_TO_POINTER(0)); - purple_plugin_pref_add_choice(pref, "Leave", GINT_TO_POINTER(1)); - purple_plugin_pref_add_choice(pref, "Receive", GINT_TO_POINTER(2)); - purple_plugin_pref_add_choice(pref, "Fist Receive", GINT_TO_POINTER(3)); - purple_plugin_pref_add_choice(pref, "Send", GINT_TO_POINTER(4)); - purple_plugin_pref_add_choice(pref, "Chat Join", GINT_TO_POINTER(5)); - purple_plugin_pref_add_choice(pref, "Chat Leave", GINT_TO_POINTER(6)); - purple_plugin_pref_add_choice(pref, "Chat You Say", GINT_TO_POINTER(7)); - purple_plugin_pref_add_choice(pref, "Chat Someone Say", GINT_TO_POINTER(8)); - purple_plugin_pref_add_choice(pref, "Pounce Default", GINT_TO_POINTER(9)); - purple_plugin_pref_add_choice(pref, "Chat Nick Said", GINT_TO_POINTER(10)); + purple_plugin_pref_set_type(pref, PURPLE_PLUGIN_PREF_CHOICE); + purple_plugin_pref_add_choice(pref, "Arrive", GINT_TO_POINTER(0)); + purple_plugin_pref_add_choice(pref, "Leave", GINT_TO_POINTER(1)); + purple_plugin_pref_add_choice(pref, "Receive", GINT_TO_POINTER(2)); + purple_plugin_pref_add_choice(pref, "Fist Receive", GINT_TO_POINTER(3)); + purple_plugin_pref_add_choice(pref, "Send", GINT_TO_POINTER(4)); + purple_plugin_pref_add_choice(pref, "Chat Join", GINT_TO_POINTER(5)); + purple_plugin_pref_add_choice(pref, "Chat Leave", GINT_TO_POINTER(6)); + purple_plugin_pref_add_choice(pref, "Chat You Say", GINT_TO_POINTER(7)); + purple_plugin_pref_add_choice(pref, "Chat Someone Say", GINT_TO_POINTER(8)); + purple_plugin_pref_add_choice(pref, "Pounce Default", GINT_TO_POINTER(9)); + purple_plugin_pref_add_choice(pref, "Chat Nick Said", GINT_TO_POINTER(10)); - purple_plugin_pref_frame_add(frame, pref); + purple_plugin_pref_frame_add(frame, pref); /* sound setting for sender */ - pref = purple_plugin_pref_new_with_name_and_label( - OPT_PLAYSOUND_SENDER, - "Play sound if sender of a message is in the sender list"); + pref = purple_plugin_pref_new_with_name_and_label(OPT_PLAYSOUND_SENDER, + "Play sound if sender of a message is in the sender list"); purple_plugin_pref_frame_add(frame, pref); /* sender list */ - pref = purple_plugin_pref_new_with_name_and_label( - OPT_USERLIST_SENDER, - "Sender List"); + pref = purple_plugin_pref_new_with_name_and_label(OPT_USERLIST_SENDER, + "Sender List"); purple_plugin_pref_frame_add(frame, pref); /* sound id selector */ - pref = purple_plugin_pref_new_with_name_and_label(OPT_SOUNDID_SENDER, "Sender Sound"); + pref = + purple_plugin_pref_new_with_name_and_label(OPT_SOUNDID_SENDER, + "Sender Sound"); - purple_plugin_pref_set_type(pref, PURPLE_PLUGIN_PREF_CHOICE); - purple_plugin_pref_add_choice(pref, "Arrive", GINT_TO_POINTER(0)); - purple_plugin_pref_add_choice(pref, "Leave", GINT_TO_POINTER(1)); - purple_plugin_pref_add_choice(pref, "Receive", GINT_TO_POINTER(2)); - purple_plugin_pref_add_choice(pref, "Fist Receive", GINT_TO_POINTER(3)); - purple_plugin_pref_add_choice(pref, "Send", GINT_TO_POINTER(4)); - purple_plugin_pref_add_choice(pref, "Chat Join", GINT_TO_POINTER(5)); - purple_plugin_pref_add_choice(pref, "Chat Leave", GINT_TO_POINTER(6)); - purple_plugin_pref_add_choice(pref, "Chat You Say", GINT_TO_POINTER(7)); - purple_plugin_pref_add_choice(pref, "Chat Someone Say", GINT_TO_POINTER(8)); - purple_plugin_pref_add_choice(pref, "Pounce Default", GINT_TO_POINTER(9)); - purple_plugin_pref_add_choice(pref, "Chat Nick Said", GINT_TO_POINTER(10)); + purple_plugin_pref_set_type(pref, PURPLE_PLUGIN_PREF_CHOICE); + purple_plugin_pref_add_choice(pref, "Arrive", GINT_TO_POINTER(0)); + purple_plugin_pref_add_choice(pref, "Leave", GINT_TO_POINTER(1)); + purple_plugin_pref_add_choice(pref, "Receive", GINT_TO_POINTER(2)); + purple_plugin_pref_add_choice(pref, "Fist Receive", GINT_TO_POINTER(3)); + purple_plugin_pref_add_choice(pref, "Send", GINT_TO_POINTER(4)); + purple_plugin_pref_add_choice(pref, "Chat Join", GINT_TO_POINTER(5)); + purple_plugin_pref_add_choice(pref, "Chat Leave", GINT_TO_POINTER(6)); + purple_plugin_pref_add_choice(pref, "Chat You Say", GINT_TO_POINTER(7)); + purple_plugin_pref_add_choice(pref, "Chat Someone Say", GINT_TO_POINTER(8)); + purple_plugin_pref_add_choice(pref, "Pounce Default", GINT_TO_POINTER(9)); + purple_plugin_pref_add_choice(pref, "Chat Nick Said", GINT_TO_POINTER(10)); - purple_plugin_pref_frame_add(frame, pref); + purple_plugin_pref_frame_add(frame, pref); return frame; } @@ -715,7 +706,7 @@ }; static void -init_plugin(PurplePlugin * plugin) +init_plugin(PurplePlugin *plugin) { g_type_init();