# HG changeset patch # User Luke Schierer # Date 1191335832 0 # Node ID 9c226e074462b148a43169a4e38faad5470584ff # Parent 61045691aa72b5a26883400cd8e1d169e96d44b6# Parent 17e605dd2de16dd345c96be351e08980681deac4 merge of '4bbc209c8076ef89135700af844ec6bb04602c0a' and 'd2c7c4e1bf264ab31a0d42e7e61e316f2ad2a718' diff -r 17e605dd2de1 -r 9c226e074462 finch/gntblist.c --- a/finch/gntblist.c Tue Oct 02 08:54:26 2007 +0000 +++ b/finch/gntblist.c Tue Oct 02 14:37:12 2007 +0000 @@ -2202,12 +2202,12 @@ group = purple_request_field_group_new(NULL); purple_request_fields_add_group(fields, group); - field = purple_request_field_string_new("screenname", _("_Name"), NULL, FALSE); + field = purple_request_field_string_new("screenname", _("Name"), NULL, FALSE); purple_request_field_set_type_hint(field, "screenname"); purple_request_field_set_required(field, TRUE); purple_request_field_group_add_field(group, field); - field = purple_request_field_account_new("account", _("_Account"), NULL); + field = purple_request_field_account_new("account", _("Account"), NULL); purple_request_field_set_type_hint(field, "account"); purple_request_field_set_visible(field, (purple_connections_get_all() != NULL && @@ -2227,6 +2227,69 @@ } static void +join_chat_select_cb(gpointer data, PurpleRequestFields *fields) +{ + PurpleAccount *account; + const char *name; + PurpleConnection *gc; + PurpleChat *chat; + GHashTable *hash = NULL; + + account = purple_request_fields_get_account(fields, "account"); + name = purple_request_fields_get_string(fields, "chat"); + + if (!purple_account_is_connected(account)) + return; + + gc = purple_account_get_connection(account); + purple_conversation_new(PURPLE_CONV_TYPE_CHAT, account, name); + chat = purple_blist_find_chat(account, name); + if (chat == NULL) { + if (PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info_defaults != NULL) + hash = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info_defaults(gc, name); + } else { + hash = chat->components; + } + serv_join_chat(gc, hash); + if (chat == NULL && hash != NULL) + g_hash_table_destroy(hash); +} + +static void +join_chat_select(GntMenuItem *item, gpointer n) +{ + PurpleRequestFields *fields; + PurpleRequestFieldGroup *group; + PurpleRequestField *field; + + fields = purple_request_fields_new(); + + group = purple_request_field_group_new(NULL); + purple_request_fields_add_group(fields, group); + + field = purple_request_field_string_new("chat", _("Channel"), NULL, FALSE); + purple_request_field_set_required(field, TRUE); + purple_request_field_group_add_field(group, field); + + field = purple_request_field_account_new("account", _("Account"), NULL); + purple_request_field_set_type_hint(field, "account"); + purple_request_field_set_visible(field, + (purple_connections_get_all() != NULL && + purple_connections_get_all()->next != NULL)); + purple_request_field_set_required(field, TRUE); + purple_request_field_group_add_field(group, field); + + purple_request_fields(purple_get_blist(), _("Join a Chat"), + NULL, + _("Please enter the name of the chat you want to join."), + fields, + _("Join"), G_CALLBACK(join_chat_select_cb), + _("Cancel"), NULL, + NULL, NULL, NULL, + NULL); +} + +static void menu_add_buddy_cb(GntMenuItem *item, gpointer null) { purple_blist_request_add_buddy(NULL, NULL, NULL, NULL); @@ -2268,6 +2331,10 @@ gnt_menu_add_item(GNT_MENU(sub), item); gnt_menuitem_set_callback(GNT_MENU_ITEM(item), send_im_select, NULL); + item = gnt_menuitem_new(_("Join Chat...")); + gnt_menu_add_item(GNT_MENU(sub), item); + gnt_menuitem_set_callback(GNT_MENU_ITEM(item), join_chat_select, NULL); + item = gnt_menuitem_new(_("Show")); gnt_menu_add_item(GNT_MENU(sub), item); subsub = gnt_menu_new(GNT_MENU_POPUP); diff -r 17e605dd2de1 -r 9c226e074462 finch/libgnt/gntbindable.h --- a/finch/libgnt/gntbindable.h Tue Oct 02 08:54:26 2007 +0000 +++ b/finch/libgnt/gntbindable.h Tue Oct 02 14:37:12 2007 +0000 @@ -105,73 +105,75 @@ /*GntBindableAction *gnt_bindable_action_parse(const char *name);*/ /** - * - * @param action + * Free a bindable action. + * + * @param action The bindable action. */ void gnt_bindable_action_free(GntBindableAction *action); /** - * - * @param param + * Free a GntBindableActionParam. + * + * @param param The GntBindableActionParam to free. */ void gnt_bindable_action_param_free(GntBindableActionParam *param); /** - * - * @param klass - * @param name - * @param callback - * @param trigger + * Register a bindable action for a class. + * + * @param klass The class the binding is for. + * @param name The name of the binding. + * @param callback The callback for the binding. + * @param trigger The default trigger for the binding, or @c NULL, followed by a NULL-terminated + * list of default parameters. */ void gnt_bindable_class_register_action(GntBindableClass *klass, const char *name, GntBindableActionCallback callback, const char *trigger, ...); /** - * - * @param klass - * @param name - * @param trigger + * Register a key-binding to an existing action. + * + * @param klass The class the binding is for. + * @param name The name of the binding. + * @param trigger A new trigger for the binding, followed by a @c NULL-terminated list of parameters for the callback. */ void gnt_bindable_register_binding(GntBindableClass *klass, const char *name, const char *trigger, ...); /** - * - * @param bindable - * @param keys + * Perform an action from a keybinding. * - * @return + * @param bindable The bindable object. + * @param keys The key to trigger the action. + * + * @return @c TRUE if the action was performed successfully, @c FALSE otherwise. */ gboolean gnt_bindable_perform_action_key(GntBindable *bindable, const char *keys); /** - * - * @param bindable - * @param name + * Perform an action on a bindable object. * - * @return + * @param bindable The bindable object. + * @param name The action to perform, followed by a @c NULL-terminated list of parameters. + * + * @return @c TRUE if the action was performed successfully, @c FALSE otherwise. */ gboolean gnt_bindable_perform_action_named(GntBindable *bindable, const char *name, ...); /** -* Returns a GntTree populated with "key" -> "binding" for the widget. -*/ -/** -* -* @param widget -* -* @return -*/ + * Returns a GntTree populated with "key" -> "binding" for the widget. + * + * @param widget The object to list the bindings for. + * + * @return The GntTree. + */ GntBindable * gnt_bindable_bindings_view(GntBindable *bind); /** - * - * Builds a window that list the key bindings for a GntBindable object. From this window a user can select a listing to rebind a new key for the given action. - * - */ -/** + * Builds a window that list the key bindings for a GntBindable object. + * From this window a user can select a listing to rebind a new key for the given action. * - * @param bindable + * @param bindable The object to list the bindings for. * - * @return + * @return @c TRUE */ gboolean gnt_bindable_build_help_window(GntBindable *bindable); diff -r 17e605dd2de1 -r 9c226e074462 finch/libgnt/gntbutton.h --- a/finch/libgnt/gntbutton.h Tue Oct 02 08:54:26 2007 +0000 +++ b/finch/libgnt/gntbutton.h Tue Oct 02 14:37:12 2007 +0000 @@ -73,17 +73,16 @@ G_BEGIN_DECLS /** - * - * - * @return + * @return GType for Gntbutton */ GType gnt_button_get_gtype(void); /** - * - * @param text + * Create a new button. * - * @return + * @param text The text for the button. + * + * @return The newly created button. */ GntWidget * gnt_button_new(const char *text); diff -r 17e605dd2de1 -r 9c226e074462 finch/libgnt/gntcheckbox.h --- a/finch/libgnt/gntcheckbox.h Tue Oct 02 08:54:26 2007 +0000 +++ b/finch/libgnt/gntcheckbox.h Tue Oct 02 14:37:12 2007 +0000 @@ -68,32 +68,33 @@ G_BEGIN_DECLS /** - * - * - * @return + * @return GType for GntCheckBox */ GType gnt_check_box_get_gtype(void); /** - * - * @param text + * Create a new checkbox. * - * @return + * @param text The text for the checkbox. + * + * @return The newly created checkbox. */ GntWidget * gnt_check_box_new(const char *text); /** - * - * @param box - * @param set + * Set whether the checkbox should be checked or not. + * + * @param box The checkbox. + * @param set @c TRUE if the checkbox should be selected, @c FALSE otherwise. */ void gnt_check_box_set_checked(GntCheckBox *box, gboolean set); /** - * - * @param box + * Return the checked state of the checkbox. * - * @return + * @param box The checkbox. + * + * @return @c TRUE if the checkbox is selected, @c FALSE otherwise. */ gboolean gnt_check_box_get_checked(GntCheckBox *box); diff -r 17e605dd2de1 -r 9c226e074462 finch/libgnt/gntclipboard.c --- a/finch/libgnt/gntclipboard.c Tue Oct 02 08:54:26 2007 +0000 +++ b/finch/libgnt/gntclipboard.c Tue Oct 02 14:37:12 2007 +0000 @@ -48,7 +48,7 @@ *****************************************************************************/ void -gnt_clipboard_set_string(GntClipboard *clipboard, gchar *string) +gnt_clipboard_set_string(GntClipboard *clipboard, const gchar *string) { g_free(clipboard->string); clipboard->string = g_strdup(string); diff -r 17e605dd2de1 -r 9c226e074462 finch/libgnt/gntclipboard.h --- a/finch/libgnt/gntclipboard.h Tue Oct 02 08:54:26 2007 +0000 +++ b/finch/libgnt/gntclipboard.h Tue Oct 02 14:37:12 2007 +0000 @@ -60,26 +60,27 @@ G_BEGIN_DECLS /** - * - * - * @return + * @return GType for GntClipboard. */ GType gnt_clipboard_get_gtype(void); /** - * - * @param clip + * Get the current text from the clipboard. * - * @return + * @param clip The clipboard. + * + * @return A copy of the string in the clipboard. The caller should free the + * returned value. */ gchar * gnt_clipboard_get_string(GntClipboard *clip); /** - * - * @param clip - * @param string + * Set the text in the clipboard. + * + * @param clip The clipboard. + * @param string New string for the clipboard. */ -void gnt_clipboard_set_string(GntClipboard *clip, gchar *string); +void gnt_clipboard_set_string(GntClipboard *clip, const gchar *string); G_END_DECLS diff -r 17e605dd2de1 -r 9c226e074462 finch/libgnt/gntcolors.h --- a/finch/libgnt/gntcolors.h Tue Oct 02 08:54:26 2007 +0000 +++ b/finch/libgnt/gntcolors.h Tue Oct 02 14:37:12 2007 +0000 @@ -29,6 +29,9 @@ #include +/** + * Different classes of colors. + */ typedef enum { GNT_COLOR_NORMAL = 1, @@ -58,27 +61,28 @@ GNT_TOTAL_COLORS }; -/* populate some default colors */ /** - * + * Initialize the colors. */ void gnt_init_colors(void); /** - * + * Uninitialize the colors. */ void gnt_uninit_colors(void); #if GLIB_CHECK_VERSION(2,6,0) /** - * - * @param kfile + * Parse color information from a file. + * + * @param kfile The file containing color information. */ void gnt_colors_parse(GKeyFile *kfile); /** - * - * @param kfile + * Parse color-pair information from a file. + * + * @param kfile The file containing the color-pair information. */ void gnt_color_pairs_parse(GKeyFile *kfile); diff -r 17e605dd2de1 -r 9c226e074462 finch/libgnt/gntcombobox.h --- a/finch/libgnt/gntcombobox.h Tue Oct 02 08:54:26 2007 +0000 +++ b/finch/libgnt/gntcombobox.h Tue Oct 02 14:37:12 2007 +0000 @@ -69,15 +69,11 @@ G_BEGIN_DECLS /** - * - * Get the GType for GntComboBox - * - * @return + * @return Get the GType for GntComboBox */ GType gnt_combo_box_get_gtype(void); /** - * * Create a new GntComboBox * * @return A new GntComboBox @@ -85,7 +81,6 @@ GntWidget * gnt_combo_box_new(void); /** - * * Add an entry * * @param box The GntComboBox @@ -95,7 +90,6 @@ void gnt_combo_box_add_data(GntComboBox *box, gpointer key, const char *text); /** - * * Remove an entry * * @param box The GntComboBox @@ -104,7 +98,6 @@ void gnt_combo_box_remove(GntComboBox *box, gpointer key); /** - * * Remove all entries * * @param box The GntComboBox @@ -112,7 +105,6 @@ void gnt_combo_box_remove_all(GntComboBox *box); /** - * * Get the data that is currently selected * * @param box The GntComboBox @@ -122,7 +114,6 @@ gpointer gnt_combo_box_get_selected_data(GntComboBox *box); /** - * * Set the current selection to a specific entry * * @param box The GntComboBox diff -r 17e605dd2de1 -r 9c226e074462 finch/libgnt/gntentry.h --- a/finch/libgnt/gntentry.h Tue Oct 02 08:54:26 2007 +0000 +++ b/finch/libgnt/gntentry.h Tue Oct 02 14:37:12 2007 +0000 @@ -100,95 +100,115 @@ G_BEGIN_DECLS /** - * - * - * @return + * @return GType for GntEntry. */ GType gnt_entry_get_gtype(void); /** - * - * @param text + * Create a new GntEntry. * - * @return + * @param text The text in the new entry box. + * + * @return The newly created entry box. */ GntWidget * gnt_entry_new(const char *text); /** - * - * @param entry - * @param max + * Set the maximum length of the text in the entry box. + * + * @param entry The entry box. + * @param max The maximum length for text. A value of 0 means infinite length. */ void gnt_entry_set_max(GntEntry *entry, int max); /** - * - * @param entry - * @param text + * Set the text in an entry box. + * + * @param entry The entry box. + * @param text The text to set in the box. */ void gnt_entry_set_text(GntEntry *entry, const char *text); /** - * - * @param entry - * @param flag + * Set flags an entry box. + * + * @param entry The entry box. + * @param flag The flags to set for the entry box. */ void gnt_entry_set_flag(GntEntry *entry, GntEntryFlag flag); +/** + * Get the text in an entry box. + * + * @param entry The entry box. + * + * @return The current text in the entry box. + */ const char *gnt_entry_get_text(GntEntry *entry); /** - * - * @param entry + * Clear the text in the entry box. + * + * @param entry The entry box. */ void gnt_entry_clear(GntEntry *entry); /** - * - * @param entry - * @param set + * Set whether the text in the entry box should be masked for display. + * + * @param entry The entry box. + * @param set @c TRUE if the text should be masked, @c FALSE otherwise. */ void gnt_entry_set_masked(GntEntry *entry, gboolean set); /** - * - * @param entry - * @param text + * Add a text to the history list for the text. The history length for the + * entry box needs to be set first by gnt_entry_set_history_length. + * + * @param entry The entry box. + * @param text A new entry for the history list. */ void gnt_entry_add_to_history(GntEntry *entry, const char *text); /** - * - * @param entry - * @param num + * Set the length of history for the entry box. + * + * @param entry The entry box. + * @param num The maximum length of the history. */ void gnt_entry_set_history_length(GntEntry *entry, int num); /** - * - * @param entry - * @param word + * Set whether the suggestions are for the entire entry box, or for each + * individual word in the entry box. + * + * @param entry The entry box. + * @param word @c TRUE if the suggestions are for individual words, @c FALSE otherwise. */ void gnt_entry_set_word_suggest(GntEntry *entry, gboolean word); /** - * - * @param entry - * @param always + * Set whether to always display the suggestions list, or only when the + * tab-completion key is pressed (the TAB key, by default). + * + * @param entry The entry box. + * @param always @c TRUE if the suggestion list should always be displayed. */ void gnt_entry_set_always_suggest(GntEntry *entry, gboolean always); /** - * - * @param entry - * @param text + * Add an item to the suggestion list. + * + * @param entry The entry box. + * @param text An item to add to the suggestion list. */ void gnt_entry_add_suggest(GntEntry *entry, const char *text); /** - * - * @param entry - * @param text + * Remove an entry from the suggestion list. + * + * @param entry The entry box. + * @param text The item to remove from the suggestion list. */ void gnt_entry_remove_suggest(GntEntry *entry, const char *text); diff -r 17e605dd2de1 -r 9c226e074462 finch/libgnt/gnttree.c --- a/finch/libgnt/gnttree.c Tue Oct 02 08:54:26 2007 +0000 +++ b/finch/libgnt/gnttree.c Tue Oct 02 14:37:12 2007 +0000 @@ -1265,8 +1265,10 @@ { GntTreeRow *pr = NULL; + row->tree = tree; + row->key = key; + row->data = NULL; g_hash_table_replace(tree->hash, key, row); - row->tree = tree; if (bigbro == NULL && tree->priv->compare) { @@ -1327,9 +1329,6 @@ } } - row->key = key; - row->data = NULL; - redraw_tree(tree); return row; diff -r 17e605dd2de1 -r 9c226e074462 libpurple/protocols/myspace/markup.c --- a/libpurple/protocols/myspace/markup.c Tue Oct 02 08:54:26 2007 +0000 +++ b/libpurple/protocols/myspace/markup.c Tue Oct 02 14:37:12 2007 +0000 @@ -444,7 +444,8 @@ *begin = g_strdup_printf("", MSIM_TEXT_UNDERLINE); *end = g_strdup(""); } else if (!purple_utf8_strcasecmp(root->name, "a")) { - const gchar *href, *link_text; + const gchar *href; + gchar *link_text; href = xmlnode_get_attrib(root, "href"); @@ -476,6 +477,7 @@ /* Sorry, kid. MySpace doesn't support you within tags. */ xmlnode_free(root->child); + g_free(link_text); root->child = NULL; *end = g_strdup(""); @@ -568,10 +570,7 @@ case XMLNODE_TYPE_DATA: /* Literal text. */ - inner = g_new0(char, node->data_sz + 1); - strncpy(inner, node->data, node->data_sz); - inner[node->data_sz] = 0; - + inner = g_strndup(node->data, node->data_sz); purple_debug_info("msim", " ** node data=%s\n", inner ? inner : "(NULL)"); break; @@ -584,6 +583,8 @@ if (inner) { g_string_append(final, inner); + g_free(inner); + inner = NULL; } } @@ -593,6 +594,9 @@ * Comment out this line below to see. */ g_string_append(final, end); + g_free(begin); + g_free(end); + purple_debug_info("msim", "msim_markup_xmlnode_to_gtkhtml: RETURNING %s\n", (final && final->str) ? final->str : "(NULL)"); diff -r 17e605dd2de1 -r 9c226e074462 libpurple/protocols/myspace/myspace.c --- a/libpurple/protocols/myspace/myspace.c Tue Oct 02 08:54:26 2007 +0000 +++ b/libpurple/protocols/myspace/myspace.c Tue Oct 02 14:37:12 2007 +0000 @@ -289,7 +289,7 @@ (int)strlen(acct->password)); /* Notify an error message also, because this is important! */ - purple_notify_error(acct, g_strdup(_("MySpaceIM Error")), str, NULL); + purple_notify_error(acct, _("MySpaceIM Error"), str, NULL); gc->wants_to_die = TRUE; purple_connection_error(gc, str); @@ -636,6 +636,7 @@ g_return_val_if_fail(username != NULL, FALSE); if (!cv) { /* No client version to record, don't worry about it. */ + g_free(username); return FALSE; } @@ -825,6 +826,7 @@ serv_got_typing_stopped(session->gc, username); g_free(username); + g_free(text); return TRUE; } @@ -973,7 +975,6 @@ purple_debug_info("msim", "msim_get_info_cb: username=%s\n", username); purple_notify_user_info_destroy(user_info); - /* TODO: do not free username, since it will be used by user_info? */ if (temporary_user) { g_free(user->client_info); @@ -987,7 +988,7 @@ g_free(user->image_url); g_free(user); } - + g_free(username); } /** Retrieve a user's profile. @@ -1166,7 +1167,7 @@ /* TODO: more elegant solution than below. attach whole message? */ /* Special elements name beginning with '_', we'll use internally within the * program (did not come directly from the wire). */ - msg = msim_msg_append(msg, "_username", MSIM_TYPE_STRING, username); + msg = msim_msg_append(msg, "_username", MSIM_TYPE_STRING, username); /* This makes 'msg' the owner of 'username' */ /* TODO: attach more useful information, like ImageURL */ @@ -1802,8 +1803,7 @@ } purple_connection_error(session->gc, full_errmsg); } else { - purple_notify_error(session->account, g_strdup(_("MySpaceIM Error")), - full_errmsg, NULL); + purple_notify_error(session->account, _("MySpaceIM Error"), full_errmsg, NULL); } g_free(full_errmsg); @@ -2674,6 +2674,7 @@ /* TODO: other fields, store in 'user' */ msim_msg_free(contact_info); + g_free(username); } /** Add first ContactID in contact_info to buddy's list. Used to add diff -r 17e605dd2de1 -r 9c226e074462 libpurple/protocols/myspace/user.c --- a/libpurple/protocols/myspace/user.c Tue Oct 02 08:54:26 2007 +0000 +++ b/libpurple/protocols/myspace/user.c Tue Oct 02 14:37:12 2007 +0000 @@ -30,10 +30,10 @@ static gchar * msim_format_now_playing(gchar *band, gchar *song) { - if ((band && strlen(band)) || (song && strlen(song))) { + if ((band && *band) || (song && *song)) { return g_strdup_printf("%s - %s", - (band && strlen(band)) ? band : "Unknown Artist", - (song && strlen(song)) ? song : "Unknown Song"); + (band && *band) ? band : "Unknown Artist", + (song && *song) ? song : "Unknown Song"); } else { return NULL; } @@ -99,58 +99,63 @@ if (full) { /* TODO: link to username, if available */ - purple_notify_user_info_add_pair(user_info, _("Profile"), - g_strdup_printf("http://myspace.com/%d", - uid, uid)); + char *profile = g_strdup_printf("http://myspace.com/%d", + uid, uid); + purple_notify_user_info_add_pair(user_info, _("Profile"), profile); + g_free(profile); } /* a/s/l...the vitals */ if (user->age) { - purple_notify_user_info_add_pair(user_info, _("Age"), - g_strdup_printf("%d", user->age)); + char age[16]; + g_snprintf(age, sizeof(age), "%d", user->age); + purple_notify_user_info_add_pair(user_info, _("Age"), age); } - if (user->gender && strlen(user->gender)) { + if (user->gender && *user->gender) { purple_notify_user_info_add_pair(user_info, _("Gender"), user->gender); } - if (user->location && strlen(user->location)) { + if (user->location && *user->location) { purple_notify_user_info_add_pair(user_info, _("Location"), user->location); } /* Other information */ - if (user->headline && strlen(user->headline)) { + if (user->headline && *user->headline) { purple_notify_user_info_add_pair(user_info, _("Headline"), user->headline); } str = msim_format_now_playing(user->band_name, user->song_name); - if (str && strlen(str)) { + if (str && *str) { purple_notify_user_info_add_pair(user_info, _("Song"), str); } + g_free(str); /* Note: total friends only available if looked up by uid, not username. */ if (user->total_friends) { - purple_notify_user_info_add_pair(user_info, _("Total Friends"), - g_strdup_printf("%d", user->total_friends)); + char friends[16]; + g_snprintf(friends, sizeof(friends), "%d", user->total_friends); + purple_notify_user_info_add_pair(user_info, _("Total Friends"), friends); } if (full) { /* Client information */ + char *client = NULL; str = user->client_info; cv = user->client_cv; if (str && cv != 0) { - purple_notify_user_info_add_pair(user_info, _("Client Version"), - g_strdup_printf("%s (build %d)", str, cv)); + client = g_strdup_printf("%s (build %d)", str, cv); } else if (str) { - purple_notify_user_info_add_pair(user_info, _("Client Version"), - g_strdup(str)); + client = g_strdup(str); } else if (cv) { - purple_notify_user_info_add_pair(user_info, _("Client Version"), - g_strdup_printf("Build %d", cv)); + client = g_strdup_printf("Build %d", cv); } + if (client && *client) + purple_notify_user_info_add_pair(user_info, _("Client Version"), client); + g_free(client); } } diff -r 17e605dd2de1 -r 9c226e074462 libpurple/purple-remote --- a/libpurple/purple-remote Tue Oct 02 08:54:26 2007 +0000 +++ b/libpurple/purple-remote Tue Oct 02 14:37:12 2007 +0000 @@ -9,7 +9,12 @@ xml.dom.minidom.Element.all = xml.dom.minidom.Element.getElementsByTagName -obj = dbus.SessionBus().get_object("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject") +obj = None +try: + obj = dbus.SessionBus().get_object("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject") +except: + pass + purple = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface") class CheckedObject: @@ -212,7 +217,10 @@ if len(sys.argv) == 1: show_help() - +elif (obj == None): + print "No existing libpurple instance detected." + sys.exit(1); + for arg in sys.argv[1:]: output = execute(arg) diff -r 17e605dd2de1 -r 9c226e074462 pidgin/plugins/gestures/stroke-draw.c --- a/pidgin/plugins/gestures/stroke-draw.c Tue Oct 02 08:54:26 2007 +0000 +++ b/pidgin/plugins/gestures/stroke-draw.c Tue Oct 02 14:37:12 2007 +0000 @@ -11,6 +11,7 @@ #include #include #include +#include #include "gstroke.h" #include "gstroke-internal.h"