Patch from Yusuke Odate, modified by me, to support retrieving the full
name and nickname/alias from the address book for Yahoo! Japan. As usual,
if it works thank Yusuke and if it's broken blame me. Fixes #3295.
line source
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /**
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * @file gtkconv.c GTK+ Conversation API
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * @ingroup pidgin
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* pidgin
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * Pidgin is the legal property of its developers, whose names are too numerous
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * to list here. Please refer to the COPYRIGHT file distributed with this
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * source distribution.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * This program is free software; you can redistribute it and/or modify
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * it under the terms of the GNU General Public License as published by
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * the Free Software Foundation; either version 2 of the License, or
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * (at your option) any later version.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * This program is distributed in the hope that it will be useful,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * GNU General Public License for more details.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * You should have received a copy of the GNU General Public License
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * along with this program; if not, write to the Free Software
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "internal.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "pidgin.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #ifndef _WIN32
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 # include <X11/Xlib.h>
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #ifdef USE_GTKSPELL
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 # include <gtkspell/gtkspell.h>
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 # ifdef _WIN32
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 # include "wspell.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 # endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include <gdk/gdkkeysyms.h>
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "account.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "cmds.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "debug.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "idle.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "imgstore.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "log.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "notify.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "prpl.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "request.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "util.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "version.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "gtkdnd-hints.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "gtkblist.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "gtkconv.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "gtkconvwin.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "gtkdialogs.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "gtkimhtml.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "gtkimhtmltoolbar.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "gtklog.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "gtkmenutray.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "gtkpounce.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "gtkprefs.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "gtkprivacy.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "gtkthemes.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "gtkutils.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "pidginstock.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "pidgintooltip.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "gtknickcolors.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #define CLOSE_CONV_TIMEOUT_SECS (10 * 60)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #define AUTO_RESPONSE "<AUTO-REPLY> : "
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 typedef enum
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PIDGIN_CONV_SET_TITLE = 1 << 0,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PIDGIN_CONV_BUDDY_ICON = 1 << 1,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PIDGIN_CONV_MENU = 1 << 2,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PIDGIN_CONV_TAB_ICON = 1 << 3,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PIDGIN_CONV_TOPIC = 1 << 4,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PIDGIN_CONV_SMILEY_THEME = 1 << 5,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PIDGIN_CONV_COLORIZE_TITLE = 1 << 6
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }PidginConvFields;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 enum {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CONV_ICON_COLUMN,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CONV_TEXT_COLUMN,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CONV_EMBLEM_COLUMN,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CONV_PROTOCOL_ICON_COLUMN,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CONV_NUM_COLUMNS
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } PidginInfopaneColumns;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #define PIDGIN_CONV_ALL ((1 << 7) - 1)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #define DEFAULT_SEND_COLOR "#204a87"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #define DEFAULT_RECV_COLOR "#cc0000"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #define DEFAULT_HIGHLIGHT_COLOR "#AF7F00"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #define DEFAULT_ACTION_COLOR "#062585"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Undef this to turn off "custom-smiley" debug messages */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #define DEBUG_CUSTOM_SMILEY
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #define LUMINANCE(c) (float)((0.3*(c.red))+(0.59*(c.green))+(0.11*(c.blue)))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* From http://www.w3.org/TR/AERT#color-contrast */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #define MIN_BRIGHTNESS_CONTRAST 75
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #define MIN_COLOR_CONTRAST 200
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #define NUM_NICK_COLORS 220
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GdkColor *nick_colors = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static guint nbr_nick_colors;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 typedef struct {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *window;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *entry;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *message;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } InviteBuddyInfo;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GtkWidget *invite_dialog = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GtkWidget *warn_close_dialog = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static PidginWindow *hidden_convwin = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GList *window_list = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Lists of status icons at all available sizes for use as window icons */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GList *available_list = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GList *away_list = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GList *busy_list = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GList *xa_list = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GList *login_list = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GList *logout_list = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GList *offline_list = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GHashTable *prpl_lists = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean update_send_to_selection(PidginWindow *win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void generate_send_to_items(PidginWindow *win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Prototypes. <-- because Paco-Paco hates this comment. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean infopane_entry_activate(PidginConversation *gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void got_typing_keypress(PidginConversation *gtkconv, gboolean first);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void gray_stuff_out(PidginConversation *gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GList *generate_invite_user_names(PurpleConnection *gc);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void add_chat_buddy_common(PurpleConversation *conv, PurpleConvChatBuddy *cb, const char *old_name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean tab_complete(PurpleConversation *conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void pidgin_conv_updated(PurpleConversation *conv, PurpleConvUpdateType type);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void conv_set_unseen(PurpleConversation *gtkconv, PidginUnseenState state);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void gtkconv_set_unseen(PidginConversation *gtkconv, PidginUnseenState state);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void update_typing_icon(PidginConversation *gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void update_typing_message(PidginConversation *gtkconv, const char *message);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static const char *item_factory_translate_func (const char *path, gpointer func_data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean pidgin_conv_has_focus(PurpleConversation *conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void pidgin_conv_custom_smiley_allocated(GdkPixbufLoader *loader, gpointer user_data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void pidgin_conv_custom_smiley_closed(GdkPixbufLoader *loader, gpointer user_data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GdkColor* generate_nick_colors(guint *numcolors, GdkColor background);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean color_is_visible(GdkColor foreground, GdkColor background, int color_contrast, int brightness_contrast);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void pidgin_conv_update_fields(PurpleConversation *conv, PidginConvFields fields);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void focus_out_from_menubar(GtkWidget *wid, PidginWindow *win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void pidgin_conv_tab_pack(PidginWindow *win, PidginConversation *gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean infopane_press_cb(GtkWidget *widget, GdkEventButton *e, PidginConversation *conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void hide_conv(PidginConversation *gtkconv, gboolean closetimer);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void pidgin_conv_set_position_size(PidginWindow *win, int x, int y,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int width, int height);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GdkColor *get_nick_color(PidginConversation *gtkconv, const char *name) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GdkColor col;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkStyle *style = gtk_widget_get_style(gtkconv->imhtml);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 float scale;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 col = nick_colors[g_str_hash(name) % nbr_nick_colors];
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 scale = ((1-(LUMINANCE(style->base[GTK_STATE_NORMAL]) / LUMINANCE(style->white))) *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (LUMINANCE(style->white)/MAX(MAX(col.red, col.blue), col.green)));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* The colors are chosen to look fine on white; we should never have to darken */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (scale > 1) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 col.red *= scale;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 col.green *= scale;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 col.blue *= scale;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return &col;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static PurpleBlistNode *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 get_conversation_blist_node(PurpleConversation *conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBlistNode *node = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 switch (purple_conversation_get_type(conv)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case PURPLE_CONV_TYPE_IM:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 node = (PurpleBlistNode*)purple_find_buddy(conv->account, conv->name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 node = node ? node->parent : NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case PURPLE_CONV_TYPE_CHAT:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 node = (PurpleBlistNode*)purple_blist_find_chat(conv->account, conv->name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 default:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return node;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /**************************************************************************
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * Callbacks
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 **************************************************************************/
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 close_this_sucker(gpointer data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv = data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *list = g_list_copy(gtkconv->convs);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_list_foreach(list, (GFunc)purple_conversation_destroy, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_list_free(list);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 close_conv_cb(GtkWidget *w, GdkEventButton *dontuse, PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* We are going to destroy the conversations immediately only if the 'close immediately'
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * preference is selected. Otherwise, close the conversation after a reasonable timeout
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * (I am going to consider 10 minutes as a 'reasonable timeout' here.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * For chats, close immediately if the chat is not in the buddylist, or if the chat is
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * not marked 'Persistent' */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleAccount *account = purple_conversation_get_account(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *name = purple_conversation_get_name(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 switch (purple_conversation_get_type(conv)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case PURPLE_CONV_TYPE_IM:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 hide_conv(gtkconv, TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case PURPLE_CONV_TYPE_CHAT:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleChat *chat = purple_blist_find_chat(account, name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!chat ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 !purple_blist_node_get_bool(&chat->node, "gtk-persistent"))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 close_this_sucker(gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 hide_conv(gtkconv, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 default:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 lbox_size_allocate_cb(GtkWidget *w, GtkAllocation *allocation, gpointer data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/chat/userlist_width", allocation->width == 1 ? 0 : allocation->width);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 default_formatize(PidginConversation *c)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = c->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_setup_entry(GTK_IMHTML(c->entry), conv->features);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 clear_formatting_cb(GtkIMHtml *imhtml, PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 default_formatize(gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static const char *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_get_cmd_prefix(void)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return "/";
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static PurpleCmdRet
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 say_command_cb(PurpleConversation *conv,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *cmd, char **args, char **error, void *data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conv_im_send(PURPLE_CONV_IM(conv), args[0]);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conv_chat_send(PURPLE_CONV_CHAT(conv), args[0]);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return PURPLE_CMD_RET_OK;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static PurpleCmdRet
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 me_command_cb(PurpleConversation *conv,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *cmd, char **args, char **error, void *data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *tmp;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tmp = g_strdup_printf("/me %s", args[0]);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conv_im_send(PURPLE_CONV_IM(conv), tmp);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conv_chat_send(PURPLE_CONV_CHAT(conv), tmp);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(tmp);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return PURPLE_CMD_RET_OK;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static PurpleCmdRet
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 debug_command_cb(PurpleConversation *conv,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *cmd, char **args, char **error, void *data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *tmp, *markup;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleCmdStatus status;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!g_ascii_strcasecmp(args[0], "version")) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tmp = g_strdup_printf("me is using %s v%s.", "Pidgin", DISPLAY_VERSION);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 markup = g_markup_escape_text(tmp, -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 status = purple_cmd_do_command(conv, tmp, markup, error);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(tmp);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(markup);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return status;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_write(conv, NULL, _("Supported debug options are: version"),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_MESSAGE_NO_LOG|PURPLE_MESSAGE_ERROR, time(NULL));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return PURPLE_CMD_STATUS_OK;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void clear_conversation_scrollback(PurpleConversation *conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *iter;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_clear(GTK_IMHTML(gtkconv->imhtml));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (iter = gtkconv->convs; iter; iter = iter->next)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_clear_message_history(iter->data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static PurpleCmdRet
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 clear_command_cb(PurpleConversation *conv,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *cmd, char **args, char **error, void *data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 clear_conversation_scrollback(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return PURPLE_CMD_STATUS_OK;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static PurpleCmdRet
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 clearall_command_cb(PurpleConversation *conv,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *cmd, char **args, char **error, void *data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_foreach(clear_conversation_scrollback);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return PURPLE_CMD_STATUS_OK;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static PurpleCmdRet
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 help_command_cb(PurpleConversation *conv,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *cmd, char **args, char **error, void *data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *l, *text;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GString *s;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (args[0] != NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 s = g_string_new("");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 text = purple_cmd_help(conv, args[0]);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (text) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (l = text; l; l = l->next)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (l->next)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_string_append_printf(s, "%s\n", (char *)l->data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_string_append_printf(s, "%s", (char *)l->data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_string_append(s, _("No such command (in this context)."));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 s = g_string_new(_("Use \"/help <command>\" for help on a specific command.\n"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "The following commands are available in this context:\n"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 text = purple_cmd_list(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (l = text; l; l = l->next)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (l->next)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_string_append_printf(s, "%s, ", (char *)l->data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_string_append_printf(s, "%s.", (char *)l->data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_list_free(text);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_write(conv, NULL, s->str, PURPLE_MESSAGE_NO_LOG, time(NULL));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_string_free(s, TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return PURPLE_CMD_STATUS_OK;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 send_history_add(PidginConversation *gtkconv, const char *message)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *first;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 first = g_list_first(gtkconv->send_history);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(first->data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 first->data = g_strdup(message);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->send_history = g_list_prepend(first, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 check_for_and_do_command(PurpleConversation *conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *cmd;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *prefix;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTextIter start;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean retval = FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 prefix = pidgin_get_cmd_prefix();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 cmd = gtk_imhtml_get_text(GTK_IMHTML(gtkconv->entry), NULL, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_get_start_iter(GTK_IMHTML(gtkconv->entry)->text_buffer, &start);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (cmd && (strncmp(cmd, prefix, strlen(prefix)) == 0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 && !gtk_text_iter_get_child_anchor(&start)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleCmdStatus status;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *error, *cmdline, *markup, *send_history;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTextIter end;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 send_history = gtk_imhtml_get_markup(GTK_IMHTML(gtkconv->entry));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 send_history_add(gtkconv, send_history);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(send_history);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 cmdline = cmd + strlen(prefix);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (strcmp(cmdline, "xyzzy") == 0) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_write(conv, "", "Nothing happens",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_MESSAGE_NO_LOG, time(NULL));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(cmd);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_iter_forward_chars(&start, g_utf8_strlen(prefix, -1));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_get_end_iter(GTK_IMHTML(gtkconv->entry)->text_buffer, &end);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 markup = gtk_imhtml_get_markup_range(GTK_IMHTML(gtkconv->entry), &start, &end);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 status = purple_cmd_do_command(conv, cmdline, markup, &error);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(markup);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 switch (status) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case PURPLE_CMD_STATUS_OK:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 retval = TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case PURPLE_CMD_STATUS_NOT_FOUND:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurplePluginProtocolInfo *prpl_info = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConnection *gc;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((gc = purple_conversation_get_gc(conv)))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((prpl_info != NULL) && (prpl_info->options & OPT_PROTO_SLASH_COMMANDS_NATIVE)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *firstspace;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *slash;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 firstspace = strchr(cmdline, ' ');
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (firstspace != NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 slash = strrchr(firstspace, '/');
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 slash = strchr(cmdline, '/');
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (slash == NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_write(conv, "", _("Unknown command."), PURPLE_MESSAGE_NO_LOG, time(NULL));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 retval = TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case PURPLE_CMD_STATUS_WRONG_ARGS:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_write(conv, "", _("Syntax Error: You typed the wrong number of arguments "
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "to that command."),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_MESSAGE_NO_LOG, time(NULL));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 retval = TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case PURPLE_CMD_STATUS_FAILED:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_write(conv, "", error ? error : _("Your command failed for an unknown reason."),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_MESSAGE_NO_LOG, time(NULL));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(error);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 retval = TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case PURPLE_CMD_STATUS_WRONG_TYPE:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_write(conv, "", _("That command only works in chats, not IMs."),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_MESSAGE_NO_LOG, time(NULL));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_write(conv, "", _("That command only works in IMs, not chats."),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_MESSAGE_NO_LOG, time(NULL));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 retval = TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case PURPLE_CMD_STATUS_WRONG_PRPL:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_write(conv, "", _("That command doesn't work on this protocol."),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_MESSAGE_NO_LOG, time(NULL));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 retval = TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(cmd);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return retval;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 send_cb(GtkWidget *widget, PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleAccount *account;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConnection *gc;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleMessageFlags flags = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *buf, *clean;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 account = purple_conversation_get_account(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (check_for_and_do_command(conv)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->entry_growing) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->entry_growing = FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_clear(GTK_IMHTML(gtkconv->entry));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conv_chat_has_left(PURPLE_CONV_CHAT(conv)))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!purple_account_is_connected(account))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buf = gtk_imhtml_get_markup(GTK_IMHTML(gtkconv->entry));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 clean = gtk_imhtml_get_text(GTK_IMHTML(gtkconv->entry), NULL, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_grab_focus(gtkconv->entry);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (strlen(clean) == 0) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(buf);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(clean);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_idle_touch();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* XXX: is there a better way to tell if the message has images? */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (GTK_IMHTML(gtkconv->entry)->im_images != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 flags |= PURPLE_MESSAGE_IMAGES;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gc = purple_account_get_connection(account);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gc && (conv->features & PURPLE_CONNECTION_NO_NEWLINES)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char **bufs;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int i;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 bufs = gtk_imhtml_get_markup_lines(GTK_IMHTML(gtkconv->entry));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (i = 0; bufs[i]; i++) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 send_history_add(gtkconv, bufs[i]);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conv_im_send_with_flags(PURPLE_CONV_IM(conv), bufs[i], flags);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conv_chat_send_with_flags(PURPLE_CONV_CHAT(conv), bufs[i], flags);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_strfreev(bufs);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 send_history_add(gtkconv, buf);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conv_im_send_with_flags(PURPLE_CONV_IM(conv), buf, flags);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conv_chat_send_with_flags(PURPLE_CONV_CHAT(conv), buf, flags);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(clean);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(buf);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_clear(GTK_IMHTML(gtkconv->entry));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->entry_growing) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->entry_growing = FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv_set_unseen(gtkconv, PIDGIN_UNSEEN_NONE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 add_remove_cb(GtkWidget *widget, PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleAccount *account;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *name;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 account = purple_conversation_get_account(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 name = purple_conversation_get_name(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBuddy *b;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 b = purple_find_buddy(account, name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (b != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_dialogs_remove_buddy(b);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (account != NULL && purple_account_is_connected(account))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_blist_request_add_buddy(account, (char *)name, NULL, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleChat *c;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 c = purple_blist_find_chat(account, name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (c != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_dialogs_remove_chat(c);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (account != NULL && purple_account_is_connected(account))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_blist_request_add_chat(account, NULL, NULL, name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_grab_focus(PIDGIN_CONVERSATION(conv)->entry);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void chat_do_info(PidginConversation *gtkconv, const char *who)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConnection *gc;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((gc = purple_conversation_get_gc(conv))) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_retrieve_user_info_in_chat(gc, who, purple_conv_chat_get_id(PURPLE_CONV_CHAT(conv)));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 info_cb(GtkWidget *widget, PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_retrieve_user_info(purple_conversation_get_gc(conv),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_get_name(conv));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_grab_focus(gtkconv->entry);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Get info of the person currently selected in the GtkTreeView */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginChatPane *gtkchat;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTreeIter iter;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTreeModel *model;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTreeSelection *sel;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *name;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkchat = gtkconv->u.chat;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 model = gtk_tree_view_get_model(GTK_TREE_VIEW(gtkchat->list));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(gtkchat->list));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtk_tree_selection_get_selected(sel, NULL, &iter))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, CHAT_USERS_NAME_COLUMN, &name, -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 chat_do_info(gtkconv, name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 block_cb(GtkWidget *widget, PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleAccount *account;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 account = purple_conversation_get_account(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (account != NULL && purple_account_is_connected(account))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_request_add_block(account, purple_conversation_get_name(conv));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_grab_focus(PIDGIN_CONVERSATION(conv)->entry);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 unblock_cb(GtkWidget *widget, PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleAccount *account;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 account = purple_conversation_get_account(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (account != NULL && purple_account_is_connected(account))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_request_add_permit(account, purple_conversation_get_name(conv));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_grab_focus(PIDGIN_CONVERSATION(conv)->entry);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 do_invite(GtkWidget *w, int resp, InviteBuddyInfo *info)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *buddy, *message;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(info->conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (resp == GTK_RESPONSE_OK) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buddy = pidgin_text_combo_box_entry_get_text(info->entry);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 message = gtk_entry_get_text(GTK_ENTRY(info->message));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!g_ascii_strcasecmp(buddy, ""))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 serv_chat_invite(purple_conversation_get_gc(info->conv),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conv_chat_get_id(PURPLE_CONV_CHAT(info->conv)),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 message, buddy);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_destroy(invite_dialog);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 invite_dialog = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(info);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 invite_dnd_recv(GtkWidget *widget, GdkDragContext *dc, gint x, gint y,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkSelectionData *sd, guint inf, guint t, gpointer data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 InviteBuddyInfo *info = (InviteBuddyInfo *)data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *convprotocol;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 convprotocol = purple_account_get_protocol_id(purple_conversation_get_account(info->conv));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (sd->target == gdk_atom_intern("PURPLE_BLIST_NODE", FALSE))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBlistNode *node = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBuddy *buddy;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 memcpy(&node, sd->data, sizeof(node));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (PURPLE_BLIST_NODE_IS_CONTACT(node))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buddy = purple_contact_get_priority_buddy((PurpleContact *)node);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (PURPLE_BLIST_NODE_IS_BUDDY(node))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buddy = (PurpleBuddy *)node;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (strcmp(convprotocol, purple_account_get_protocol_id(buddy->account)))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_notify_error(PIDGIN_CONVERSATION(info->conv), NULL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 _("That buddy is not on the same protocol as this "
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "chat."), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_text_combo_box_entry_set_text(info->entry, buddy->name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_drag_finish(dc, TRUE, (dc->action == GDK_ACTION_MOVE), t);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (sd->target == gdk_atom_intern("application/x-im-contact", FALSE))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *protocol = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *username = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleAccount *account;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (pidgin_parse_x_im_contact((const char *)sd->data, FALSE, &account,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 &protocol, &username, NULL))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (account == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_notify_error(PIDGIN_CONVERSATION(info->conv), NULL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 _("You are not currently signed on with an account that "
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "can invite that buddy."), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (strcmp(convprotocol, purple_account_get_protocol_id(account)))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_notify_error(PIDGIN_CONVERSATION(info->conv), NULL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 _("That buddy is not on the same protocol as this "
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "chat."), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_text_combo_box_entry_set_text(info->entry, username);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(username);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(protocol);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_drag_finish(dc, TRUE, (dc->action == GDK_ACTION_MOVE), t);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static const GtkTargetEntry dnd_targets[] =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {"PURPLE_BLIST_NODE", GTK_TARGET_SAME_APP, 0},
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {"application/x-im-contact", 0, 1}
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 };
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 invite_cb(GtkWidget *widget, PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 InviteBuddyInfo *info = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (invite_dialog == NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConnection *gc;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *gtkwin;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *label;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *vbox, *hbox;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *table;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *img;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 img = gtk_image_new_from_stock(PIDGIN_STOCK_DIALOG_QUESTION,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_HUGE));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 info = g_new0(InviteBuddyInfo, 1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 info->conv = conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gc = purple_conversation_get_gc(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkwin = pidgin_conv_get_window(gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Create the new dialog. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 invite_dialog = gtk_dialog_new_with_buttons(
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 _("Invite Buddy Into Chat Room"),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_WINDOW(gtkwin->window), 0,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PIDGIN_STOCK_INVITE, GTK_RESPONSE_OK, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_dialog_set_default_response(GTK_DIALOG(invite_dialog),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_RESPONSE_OK);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_container_set_border_width(GTK_CONTAINER(invite_dialog), PIDGIN_HIG_BOX_SPACE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_window_set_resizable(GTK_WINDOW(invite_dialog), FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_dialog_set_has_separator(GTK_DIALOG(invite_dialog), FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 info->window = GTK_WIDGET(invite_dialog);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Setup the outside spacing. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 vbox = GTK_DIALOG(invite_dialog)->vbox;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_set_spacing(GTK_BOX(vbox), PIDGIN_HIG_BORDER);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_container_set_border_width(GTK_CONTAINER(vbox), PIDGIN_HIG_BOX_SPACE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Setup the inner hbox and put the dialog's icon in it. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BORDER);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_container_add(GTK_CONTAINER(vbox), hbox);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_misc_set_alignment(GTK_MISC(img), 0, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Setup the right vbox. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 vbox = gtk_vbox_new(FALSE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_container_add(GTK_CONTAINER(hbox), vbox);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Put our happy label in it. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 label = gtk_label_new(_("Please enter the name of the user you wish "
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "to invite, along with an optional invite "
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "message."));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_size_request(label, 350, -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* hbox for the table, and to give it some spacing on the left. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_container_add(GTK_CONTAINER(vbox), hbox);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Setup the table we're going to use to lay stuff out. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 table = gtk_table_new(2, 2, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_table_set_row_spacings(GTK_TABLE(table), PIDGIN_HIG_BOX_SPACE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_table_set_col_spacings(GTK_TABLE(table), PIDGIN_HIG_BOX_SPACE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_container_set_border_width(GTK_CONTAINER(table), PIDGIN_HIG_BORDER);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Now the Buddy label */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 label = gtk_label_new(NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_label_set_markup_with_mnemonic(GTK_LABEL(label), _("_Buddy:"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 0, 1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Now the Buddy drop-down entry field. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 info->entry = pidgin_text_combo_box_entry_new(NULL, generate_invite_user_names(gc));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_table_attach_defaults(GTK_TABLE(table), info->entry, 1, 2, 0, 1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_label_set_mnemonic_widget(GTK_LABEL(label), info->entry);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Now the label for "Message" */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 label = gtk_label_new(NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_label_set_markup_with_mnemonic(GTK_LABEL(label), _("_Message:"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* And finally, the Message entry field. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 info->message = gtk_entry_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_entry_set_activates_default(GTK_ENTRY(info->message), TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_table_attach_defaults(GTK_TABLE(table), info->message, 1, 2, 1, 2);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_label_set_mnemonic_widget(GTK_LABEL(label), info->message);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Connect the signals. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(invite_dialog), "response",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(do_invite), info);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Setup drag-and-drop */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_drag_dest_set(info->window,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_DEST_DEFAULT_MOTION |
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_DEST_DEFAULT_DROP,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 dnd_targets,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 sizeof(dnd_targets) / sizeof(GtkTargetEntry),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GDK_ACTION_COPY);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_drag_dest_set(info->entry,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_DEST_DEFAULT_MOTION |
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_DEST_DEFAULT_DROP,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 dnd_targets,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 sizeof(dnd_targets) / sizeof(GtkTargetEntry),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GDK_ACTION_COPY);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(info->window), "drag_data_received",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(invite_dnd_recv), info);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(info->entry), "drag_data_received",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(invite_dnd_recv), info);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show_all(invite_dialog);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (info != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_grab_focus(GTK_BIN(info->entry)->child);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu_new_conv_cb(gpointer data, guint action, GtkWidget *widget)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_dialogs_im();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 savelog_writefile_cb(void *user_data, const char *filename)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = (PurpleConversation *)user_data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 FILE *fp;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *name;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char **lines;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gchar *text;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((fp = g_fopen(filename, "w+")) == NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_notify_error(PIDGIN_CONVERSATION(conv), NULL, _("Unable to open file."), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 name = purple_conversation_get_name(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 fprintf(fp, "<html>\n<head><title>%s</title></head>\n<body>", name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 fprintf(fp, _("<h1>Conversation with %s</h1>\n"), name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 lines = gtk_imhtml_get_markup_lines(
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_IMHTML(PIDGIN_CONVERSATION(conv)->imhtml));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 text = g_strjoinv("<br>\n", lines);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 fprintf(fp, "%s", text);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(text);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_strfreev(lines);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 fprintf(fp, "\n</body>\n</html>\n");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 fclose(fp);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /*
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * It would be kinda cool if this gave the option of saving a
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * plaintext v. HTML file.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu_save_as_cb(gpointer data, guint action, GtkWidget *widget)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win = data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = pidgin_conv_window_get_active_conversation(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBuddy *buddy = purple_find_buddy(conv->account, conv->name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *name;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gchar *buf;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gchar *c;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (buddy != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 name = purple_buddy_get_contact_alias(buddy);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 name = purple_normalize(conv->account, conv->name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buf = g_strdup_printf("%s.html", name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (c = buf ; *c ; c++)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (*c == '/' || *c == '\\')
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 *c = ' ';
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_request_file(PIDGIN_CONVERSATION(conv), _("Save Conversation"),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buf,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 TRUE, G_CALLBACK(savelog_writefile_cb), NULL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 NULL, NULL, conv,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(buf);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu_view_log_cb(gpointer data, guint action, GtkWidget *widget)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win = data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleLogType type;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginBuddyList *gtkblist;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkCursor *cursor;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *name;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleAccount *account;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GSList *buddies;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GSList *cur;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = pidgin_conv_window_get_active_conversation(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 type = PURPLE_LOG_IM;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 type = PURPLE_LOG_CHAT;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkblist = pidgin_blist_get_default_gtk_blist();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 cursor = gdk_cursor_new(GDK_WATCH);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gdk_window_set_cursor(gtkblist->window->window, cursor);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gdk_window_set_cursor(win->window->window, cursor);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gdk_cursor_unref(cursor);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #if GTK_CHECK_VERSION(2,4,0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gdk_display_flush(gdk_drawable_get_display(GDK_DRAWABLE(widget->window)));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gdk_flush();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 name = purple_conversation_get_name(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 account = purple_conversation_get_account(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buddies = purple_find_buddies(account, name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (cur = buddies; cur != NULL; cur = cur->next)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBlistNode *node = cur->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((node != NULL) && ((node->prev != NULL) || (node->next != NULL)))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_log_show_contact((PurpleContact *)node->parent);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_slist_free(buddies);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gdk_window_set_cursor(gtkblist->window->window, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gdk_window_set_cursor(win->window->window, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_slist_free(buddies);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_log_show(type, name, account);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gdk_window_set_cursor(gtkblist->window->window, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gdk_window_set_cursor(win->window->window, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu_clear_cb(gpointer data, guint action, GtkWidget *widget)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win = data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = pidgin_conv_window_get_active_conversation(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 clear_conversation_scrollback(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 struct _search {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *gtkwin;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *entry;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 };
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void do_search_cb(GtkWidget *widget, gint resp, struct _search *s)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtk_active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *iter;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = pidgin_conv_window_get_active_conversation(s->gtkwin);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_active_conv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 switch (resp)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case GTK_RESPONSE_OK:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* clear highlighting except the active conversation window
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * highlight the keywords in the active conversation window */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (iter = pidgin_conv_window_get_gtkconvs(s->gtkwin) ; iter ; iter = iter->next)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv = iter->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv != gtk_active_conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_search_clear(GTK_IMHTML(gtkconv->imhtml));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_search_find(GTK_IMHTML(gtk_active_conv->imhtml),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_entry_get_text(GTK_ENTRY(s->entry)));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case GTK_RESPONSE_DELETE_EVENT:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case GTK_RESPONSE_CLOSE:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* clear the keyword highlighting in all the conversation windows */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (iter = pidgin_conv_window_get_gtkconvs(s->gtkwin); iter; iter=iter->next)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gconv = iter->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_search_clear(GTK_IMHTML(gconv->imhtml));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_destroy(s->gtkwin->dialogs.search);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 s->gtkwin->dialogs.search = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(s);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu_find_cb(gpointer data, guint action, GtkWidget *widget)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *gtkwin = data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *hbox;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *img = gtk_image_new_from_stock(PIDGIN_STOCK_DIALOG_QUESTION,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_HUGE));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *label;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 struct _search *s;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkwin->dialogs.search) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_window_present(GTK_WINDOW(gtkwin->dialogs.search));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 s = g_malloc(sizeof(struct _search));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 s->gtkwin = gtkwin;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkwin->dialogs.search = gtk_dialog_new_with_buttons(_("Find"),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_WINDOW(gtkwin->window), GTK_DIALOG_DESTROY_WITH_PARENT,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_STOCK_FIND, GTK_RESPONSE_OK, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_dialog_set_default_response(GTK_DIALOG(gtkwin->dialogs.search),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_RESPONSE_OK);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(gtkwin->dialogs.search), "response",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(do_search_cb), s);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_container_set_border_width(GTK_CONTAINER(gtkwin->dialogs.search), PIDGIN_HIG_BOX_SPACE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_window_set_resizable(GTK_WINDOW(gtkwin->dialogs.search), FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_dialog_set_has_separator(GTK_DIALOG(gtkwin->dialogs.search), FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(gtkwin->dialogs.search)->vbox), PIDGIN_HIG_BORDER);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_container_set_border_width(
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_CONTAINER(GTK_DIALOG(gtkwin->dialogs.search)->vbox), PIDGIN_HIG_BOX_SPACE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BORDER);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(gtkwin->dialogs.search)->vbox),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 hbox);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_misc_set_alignment(GTK_MISC(img), 0, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_dialog_set_response_sensitive(GTK_DIALOG(gtkwin->dialogs.search),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_RESPONSE_OK, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 label = gtk_label_new(NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_label_set_markup_with_mnemonic(GTK_LABEL(label), _("_Search for:"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 s->entry = gtk_entry_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_entry_set_activates_default(GTK_ENTRY(s->entry), TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_label_set_mnemonic_widget(GTK_LABEL(label), GTK_WIDGET(s->entry));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(s->entry), "changed",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(pidgin_set_sensitive_if_input),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkwin->dialogs.search);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(hbox), s->entry, FALSE, FALSE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show_all(gtkwin->dialogs.search);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_grab_focus(s->entry);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu_send_file_cb(gpointer data, guint action, GtkWidget *widget)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win = data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = pidgin_conv_window_get_active_conversation(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 serv_send_file(purple_conversation_get_gc(conv), purple_conversation_get_name(conv), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu_add_pounce_cb(gpointer data, guint action, GtkWidget *widget)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win = data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = pidgin_conv_window_get_active_gtkconv(win)->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_pounce_editor_show(purple_conversation_get_account(conv),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_get_name(conv), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu_insert_link_cb(gpointer data, guint action, GtkWidget *widget)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win = data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkIMHtmlToolbar *toolbar;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = pidgin_conv_window_get_active_gtkconv(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 toolbar = GTK_IMHTMLTOOLBAR(gtkconv->toolbar);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toolbar->link),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(toolbar->link)));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu_insert_image_cb(gpointer data, guint action, GtkWidget *widget)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win = data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkIMHtmlToolbar *toolbar;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = pidgin_conv_window_get_active_gtkconv(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 toolbar = GTK_IMHTMLTOOLBAR(gtkconv->toolbar);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toolbar->image),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(toolbar->image)));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu_alias_cb(gpointer data, guint action, GtkWidget *widget)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win = data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleAccount *account;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *name;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = pidgin_conv_window_get_active_conversation(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 account = purple_conversation_get_account(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 name = purple_conversation_get_name(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBuddy *b;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 b = purple_find_buddy(account, name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (b != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_dialogs_alias_buddy(b);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleChat *c;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 c = purple_blist_find_chat(account, name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (c != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_dialogs_alias_chat(c);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu_get_info_cb(gpointer data, guint action, GtkWidget *widget)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win = data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = pidgin_conv_window_get_active_conversation(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 info_cb(NULL, PIDGIN_CONVERSATION(conv));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu_invite_cb(gpointer data, guint action, GtkWidget *widget)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win = data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = pidgin_conv_window_get_active_conversation(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 invite_cb(NULL, PIDGIN_CONVERSATION(conv));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu_block_cb(gpointer data, guint action, GtkWidget *widget)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win = data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = pidgin_conv_window_get_active_conversation(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 block_cb(NULL, PIDGIN_CONVERSATION(conv));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu_unblock_cb(gpointer data, guint action, GtkWidget *widget)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win = data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = pidgin_conv_window_get_active_conversation(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 unblock_cb(NULL, PIDGIN_CONVERSATION(conv));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu_add_remove_cb(gpointer data, guint action, GtkWidget *widget)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win = data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = pidgin_conv_window_get_active_conversation(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 add_remove_cb(NULL, PIDGIN_CONVERSATION(conv));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 close_already(gpointer data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_destroy(data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 hide_conv(PidginConversation *gtkconv, gboolean closetimer)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *list;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_emit(pidgin_conversations_get_handle(),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "conversation-hiding", gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (list = g_list_copy(gtkconv->convs); list; list = g_list_delete_link(list, list)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = list->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (closetimer) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 guint timer = GPOINTER_TO_INT(purple_conversation_get_data(conv, "close-timer"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (timer)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_timeout_remove(timer);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 timer = purple_timeout_add_seconds(CLOSE_CONV_TIMEOUT_SECS, close_already, conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_set_data(conv, "close-timer", GINT_TO_POINTER(timer));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #if 0
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* I will miss you */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_set_ui_ops(conv, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_remove_gtkconv(gtkconv->win, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_add_gtkconv(hidden_convwin, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu_close_conv_cb(gpointer data, guint action, GtkWidget *widget)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win = data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 close_conv_cb(NULL, NULL, PIDGIN_CONVERSATION(pidgin_conv_window_get_active_conversation(win)));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu_logging_cb(gpointer data, guint action, GtkWidget *widget)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win = data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean logging;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBlistNode *node;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = pidgin_conv_window_get_active_conversation(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (conv == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 logging = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (logging == purple_conversation_is_logging(conv))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 node = get_conversation_blist_node(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (logging)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Enable logging first so the message below can be logged. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_set_logging(conv, TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_write(conv, NULL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 _("Logging started. Future messages in this conversation will be logged."),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv->logs ? (PURPLE_MESSAGE_SYSTEM) :
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LOG),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 time(NULL));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_write(conv, NULL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 _("Logging stopped. Future messages in this conversation will not be logged."),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv->logs ? (PURPLE_MESSAGE_SYSTEM) :
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LOG),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 time(NULL));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Disable the logging second, so that the above message can be logged. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_set_logging(conv, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Save the setting IFF it's different than the pref. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 switch (conv->type)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case PURPLE_CONV_TYPE_IM:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (logging == purple_prefs_get_bool("/purple/logging/log_ims"))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_blist_node_remove_setting(node, "enable-logging");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_blist_node_set_bool(node, "enable-logging", logging);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case PURPLE_CONV_TYPE_CHAT:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (logging == purple_prefs_get_bool("/purple/logging/log_chats"))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_blist_node_remove_setting(node, "enable-logging");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_blist_node_set_bool(node, "enable-logging", logging);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 default:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu_toolbar_cb(gpointer data, guint action, GtkWidget *widget)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/show_formatting_toolbar",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget)));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu_sounds_cb(gpointer data, guint action, GtkWidget *widget)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win = data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBlistNode *node;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = pidgin_conv_window_get_active_conversation(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->make_sound =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 node = get_conversation_blist_node(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (node)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_blist_node_set_bool(node, "gtk-mute-sound", !gtkconv->make_sound);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu_timestamps_cb(gpointer data, guint action, GtkWidget *widget)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/show_timestamps",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget)));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 chat_do_im(PidginConversation *gtkconv, const char *who)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleAccount *account;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConnection *gc;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurplePluginProtocolInfo *prpl_info = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *real_who;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 account = purple_conversation_get_account(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(account != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gc = purple_account_get_connection(account);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(gc != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (prpl_info && prpl_info->get_cb_real_name)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 real_who = prpl_info->get_cb_real_name(gc,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conv_chat_get_id(PURPLE_CONV_CHAT(conv)), who);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 real_who = g_strdup(who);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(!real_who)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_dialogs_im_with_user(account, real_who);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(real_who);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void pidgin_conv_chat_update_user(PurpleConversation *conv, const char *user);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ignore_cb(GtkWidget *w, PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConvChat *chat;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *name;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 chat = PURPLE_CONV_CHAT(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 name = g_object_get_data(G_OBJECT(w), "user_data");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (name == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conv_chat_is_user_ignored(chat, name))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conv_chat_unignore(chat, name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conv_chat_ignore(chat, name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_chat_update_user(conv, name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu_chat_im_cb(GtkWidget *w, PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *who = g_object_get_data(G_OBJECT(w), "user_data");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 chat_do_im(gtkconv, who);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu_chat_send_file_cb(GtkWidget *w, PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *who = g_object_get_data(G_OBJECT(w), "user_data");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConnection *gc = purple_conversation_get_gc(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 serv_send_file(gc, who, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu_chat_info_cb(GtkWidget *w, PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *who;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 who = g_object_get_data(G_OBJECT(w), "user_data");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 chat_do_info(gtkconv, who);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu_chat_get_away_cb(GtkWidget *w, PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurplePluginProtocolInfo *prpl_info = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConnection *gc;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *who;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gc = purple_conversation_get_gc(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 who = g_object_get_data(G_OBJECT(w), "user_data");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gc != NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /*
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * May want to expand this to work similarly to menu_info_cb?
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (prpl_info->get_cb_away != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 prpl_info->get_cb_away(gc,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conv_chat_get_id(PURPLE_CONV_CHAT(conv)), who);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu_chat_add_remove_cb(GtkWidget *w, PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleAccount *account;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBuddy *b;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *name;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 account = purple_conversation_get_account(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 name = g_object_get_data(G_OBJECT(w), "user_data");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 b = purple_find_buddy(account, name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (b != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_dialogs_remove_buddy(b);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (account != NULL && purple_account_is_connected(account))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_blist_request_add_buddy(account, name, NULL, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_grab_focus(PIDGIN_CONVERSATION(conv)->entry);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GtkTextMark *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 get_mark_for_user(PidginConversation *gtkconv, const char *who)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTextBuffer *buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->imhtml));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *tmp = g_strconcat("user:", who, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTextMark *mark = gtk_text_buffer_get_mark(buf, tmp);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(tmp);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return mark;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu_last_said_cb(GtkWidget *w, PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTextMark *mark;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *who;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 who = g_object_get_data(G_OBJECT(w), "user_data");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 mark = get_mark_for_user(gtkconv, who);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (mark != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(gtkconv->imhtml), mark, 0.1, FALSE, 0, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_reached();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GtkWidget *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 create_chat_menu(PurpleConversation *conv, const char *who, PurpleConnection *gc)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GtkWidget *menu = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurplePluginProtocolInfo *prpl_info = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConvChat *chat = PURPLE_CONV_CHAT(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean is_me = FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *button;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBuddy *buddy = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gc != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /*
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * If a menu already exists, destroy it before creating a new one,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * thus freeing-up the memory it occupied.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (menu)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_destroy(menu);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!strcmp(chat->nick, purple_normalize(conv->account, who)))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 is_me = TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu = gtk_menu_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!is_me) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 button = pidgin_new_item_from_stock(menu, _("IM"), PIDGIN_STOCK_TOOLBAR_MESSAGE_NEW,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(menu_chat_im_cb), PIDGIN_CONVERSATION(conv), 0, 0, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gc == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(button, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set_data_full(G_OBJECT(button), "user_data", g_strdup(who), g_free);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (prpl_info && prpl_info->send_file)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 button = pidgin_new_item_from_stock(menu, _("Send File"),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PIDGIN_STOCK_TOOLBAR_SEND_FILE, G_CALLBACK(menu_chat_send_file_cb),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PIDGIN_CONVERSATION(conv), 0, 0, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gc == NULL || prpl_info == NULL ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 !(!prpl_info->can_receive_file || prpl_info->can_receive_file(gc, who)))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(button, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set_data_full(G_OBJECT(button), "user_data", g_strdup(who), g_free);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conv_chat_is_user_ignored(PURPLE_CONV_CHAT(conv), who))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 button = pidgin_new_item_from_stock(menu, _("Un-Ignore"), PIDGIN_STOCK_IGNORE,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(ignore_cb), PIDGIN_CONVERSATION(conv), 0, 0, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 button = pidgin_new_item_from_stock(menu, _("Ignore"), PIDGIN_STOCK_IGNORE,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(ignore_cb), PIDGIN_CONVERSATION(conv), 0, 0, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gc == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(button, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set_data_full(G_OBJECT(button), "user_data", g_strdup(who), g_free);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (prpl_info && (prpl_info->get_info || prpl_info->get_cb_info)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 button = pidgin_new_item_from_stock(menu, _("Info"), PIDGIN_STOCK_TOOLBAR_USER_INFO,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(menu_chat_info_cb), PIDGIN_CONVERSATION(conv), 0, 0, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gc == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(button, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set_data_full(G_OBJECT(button), "user_data", g_strdup(who), g_free);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (prpl_info && prpl_info->get_cb_away) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 button = pidgin_new_item_from_stock(menu, _("Get Away Message"), PIDGIN_STOCK_AWAY,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(menu_chat_get_away_cb), PIDGIN_CONVERSATION(conv), 0, 0, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gc == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(button, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set_data_full(G_OBJECT(button), "user_data", g_strdup(who), g_free);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!is_me && prpl_info && !(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((buddy = purple_find_buddy(conv->account, who)) != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 button = pidgin_new_item_from_stock(menu, _("Remove"), GTK_STOCK_REMOVE,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(menu_chat_add_remove_cb), PIDGIN_CONVERSATION(conv), 0, 0, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 button = pidgin_new_item_from_stock(menu, _("Add"), GTK_STOCK_ADD,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(menu_chat_add_remove_cb), PIDGIN_CONVERSATION(conv), 0, 0, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gc == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(button, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set_data_full(G_OBJECT(button), "user_data", g_strdup(who), g_free);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 button = pidgin_new_item_from_stock(menu, _("Last said"), GTK_STOCK_INDEX,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(menu_last_said_cb), PIDGIN_CONVERSATION(conv), 0, 0, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set_data_full(G_OBJECT(button), "user_data", g_strdup(who), g_free);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!get_mark_for_user(PIDGIN_CONVERSATION(conv), who))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(button, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (buddy != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_account_is_connected(conv->account))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_append_blist_node_proto_menu(menu, conv->account->gc,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (PurpleBlistNode *)buddy);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_append_blist_node_extended_menu(menu, (PurpleBlistNode *)buddy);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show_all(menu);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return menu;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gint
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv_chat_popup_menu_cb(GtkWidget *widget, PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginChatPane *gtkchat;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConnection *gc;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleAccount *account;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTreeSelection *sel;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTreeIter iter;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTreeModel *model;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *menu;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gchar *who;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkchat = gtkconv->u.chat;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 account = purple_conversation_get_account(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gc = account->gc;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 model = gtk_tree_view_get_model(GTK_TREE_VIEW(gtkchat->list));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(gtkchat->list));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(!gtk_tree_selection_get_selected(sel, NULL, &iter))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, CHAT_USERS_NAME_COLUMN, &who, -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu = create_chat_menu (conv, who, gc);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_menu_popup(GTK_MENU(menu), NULL, NULL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_treeview_popup_menu_position_func, widget,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 0, GDK_CURRENT_TIME);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(who);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gint
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 right_click_chat_cb(GtkWidget *widget, GdkEventButton *event,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginChatPane *gtkchat;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConnection *gc;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleAccount *account;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTreePath *path;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTreeIter iter;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTreeModel *model;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTreeViewColumn *column;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gchar *who;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int x, y;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkchat = gtkconv->u.chat;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 account = purple_conversation_get_account(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gc = account->gc;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 model = gtk_tree_view_get_model(GTK_TREE_VIEW(gtkchat->list));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(gtkchat->list),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 event->x, event->y, &path, &column, &x, &y);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (path == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_tree_selection_select_path(GTK_TREE_SELECTION(
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_tree_view_get_selection(GTK_TREE_VIEW(gtkchat->list))), path);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_tree_view_set_cursor(GTK_TREE_VIEW(gtkchat->list),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 path, NULL, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_grab_focus(GTK_WIDGET(gtkchat->list));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, path);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, CHAT_USERS_NAME_COLUMN, &who, -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (event->button == 1 && event->type == GDK_2BUTTON_PRESS) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 chat_do_im(gtkconv, who);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (event->button == 2 && event->type == GDK_BUTTON_PRESS) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Move to user's anchor */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTextMark *mark = get_mark_for_user(gtkconv, who);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(mark != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(gtkconv->imhtml), mark, 0.1, FALSE, 0, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (event->button == 3 && event->type == GDK_BUTTON_PRESS) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *menu = create_chat_menu (conv, who, gc);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 event->button, event->time);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(who);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_tree_path_free(path);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 move_to_next_unread_tab(PidginConversation *gtkconv, gboolean forward)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *next_gtkconv = NULL, *most_active = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginUnseenState unseen_state = PIDGIN_UNSEEN_NONE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int initial, i, total, diff;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win = gtkconv->win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 initial = gtk_notebook_page_num(GTK_NOTEBOOK(win->notebook),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->tab_cont);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 total = pidgin_conv_window_get_gtkconv_count(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* By adding total here, the moduli calculated later will always have two
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * positive arguments. x % y where x < 0 is not guaranteed to return a
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * positive number.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 diff = (forward ? 1 : -1) + total;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (i = (initial + diff) % total; i != initial; i = (i + diff) % total) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 next_gtkconv = pidgin_conv_window_get_gtkconv_at_index(win, i);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (next_gtkconv->unseen_state > unseen_state) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 most_active = next_gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 unseen_state = most_active->unseen_state;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(PIDGIN_UNSEEN_NICK == unseen_state) /* highest possible state */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (most_active == NULL) { /* no new messages */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 i = (i + diff) % total;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 most_active = pidgin_conv_window_get_gtkconv_at_index(win, i);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (most_active != NULL && most_active != gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_switch_gtkconv(win, most_active);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_keypress_common(PidginConversation *gtkconv, GdkEventKey *event)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int curconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win = gtkconv->win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 curconv = gtk_notebook_get_current_page(GTK_NOTEBOOK(win->notebook));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* If CTRL was held down... */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (event->state & GDK_CONTROL_MASK) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 switch (event->keyval) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case GDK_Page_Down:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case ']':
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!pidgin_conv_window_get_gtkconv_at_index(win, curconv + 1))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_set_current_page(GTK_NOTEBOOK(win->notebook), 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_set_current_page(GTK_NOTEBOOK(win->notebook), curconv + 1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case GDK_Page_Up:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case '[':
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!pidgin_conv_window_get_gtkconv_at_index(win, curconv - 1))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_set_current_page(GTK_NOTEBOOK(win->notebook), -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_set_current_page(GTK_NOTEBOOK(win->notebook), curconv - 1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case GDK_Tab:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case GDK_ISO_Left_Tab:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (event->state & GDK_SHIFT_MASK) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 move_to_next_unread_tab(gtkconv, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 move_to_next_unread_tab(gtkconv, TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case GDK_comma:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_reorder_child(GTK_NOTEBOOK(win->notebook),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_get_nth_page(GTK_NOTEBOOK(win->notebook), curconv),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 curconv - 1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case GDK_period:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_reorder_child(GTK_NOTEBOOK(win->notebook),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_get_nth_page(GTK_NOTEBOOK(win->notebook), curconv),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #if GTK_CHECK_VERSION(2,2,0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (curconv + 1) % gtk_notebook_get_n_pages(GTK_NOTEBOOK(win->notebook)));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (curconv + 1) % g_list_length(GTK_NOTEBOOK(win->notebook)->children));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } /* End of switch */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* If ALT (or whatever) was held down... */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (event->state & GDK_MOD1_MASK)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (event->keyval > '0' && event->keyval <= '9')
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 guint switchto = event->keyval - '1';
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (switchto < pidgin_conv_window_get_gtkconv_count(win))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_set_current_page(GTK_NOTEBOOK(win->notebook), switchto);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* If neither CTRL nor ALT were held down... */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 switch (event->keyval) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case GDK_F2:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtk_widget_is_focus(GTK_WIDGET(win->notebook))) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 infopane_entry_activate(gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 entry_key_press_cb(GtkWidget *entry, GdkEventKey *event, gpointer data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = (PidginConversation *)data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win = gtkconv->win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (conv_keypress_common(gtkconv, event))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* If CTRL was held down... */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (event->state & GDK_CONTROL_MASK) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 switch (event->keyval) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case GDK_Up:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!gtkconv->send_history)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->entry != entry)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!gtkconv->send_history->prev) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTextIter start, end;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(gtkconv->send_history->data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_get_start_iter(gtkconv->entry_buffer,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 &start);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_get_end_iter(gtkconv->entry_buffer, &end);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->send_history->data =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_get_markup(GTK_IMHTML(gtkconv->entry));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->send_history->next && gtkconv->send_history->next->data) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GObject *object;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTextIter iter;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->entry));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->send_history = gtkconv->send_history->next;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Block the signal to prevent application of default formatting. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 object = g_object_ref(G_OBJECT(gtkconv->entry));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_handlers_block_matched(object, G_SIGNAL_MATCH_DATA, 0, 0, NULL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 NULL, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Clear the formatting. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_clear_formatting(GTK_IMHTML(gtkconv->entry));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Unblock the signal. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_handlers_unblock_matched(object, G_SIGNAL_MATCH_DATA, 0, 0, NULL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 NULL, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_unref(object);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_clear(GTK_IMHTML(gtkconv->entry));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_append_text_with_images(
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_IMHTML(gtkconv->entry), gtkconv->send_history->data,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 0, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* this is mainly just a hack so the formatting at the
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * cursor gets picked up. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_get_end_iter(buffer, &iter);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_move_mark_by_name(buffer, "insert", &iter);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case GDK_Down:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!gtkconv->send_history)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->entry != entry)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->send_history->prev && gtkconv->send_history->prev->data) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GObject *object;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTextIter iter;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->entry));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->send_history = gtkconv->send_history->prev;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Block the signal to prevent application of default formatting. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 object = g_object_ref(G_OBJECT(gtkconv->entry));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_handlers_block_matched(object, G_SIGNAL_MATCH_DATA, 0, 0, NULL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 NULL, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Clear the formatting. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_clear_formatting(GTK_IMHTML(gtkconv->entry));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Unblock the signal. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_handlers_unblock_matched(object, G_SIGNAL_MATCH_DATA, 0, 0, NULL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 NULL, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_unref(object);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_clear(GTK_IMHTML(gtkconv->entry));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_append_text_with_images(
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_IMHTML(gtkconv->entry), gtkconv->send_history->data,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 0, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* this is mainly just a hack so the formatting at the
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * cursor gets picked up. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (*(char *)gtkconv->send_history->data) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_get_end_iter(buffer, &iter);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_move_mark_by_name(buffer, "insert", &iter);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Restore the default formatting */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 default_formatize(gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } /* End of switch */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* If ALT (or whatever) was held down... */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (event->state & GDK_MOD1_MASK) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* If neither CTRL nor ALT were held down... */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 switch (event->keyval) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case GDK_Tab:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->entry != entry)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return tab_complete(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case GDK_Page_Up:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_page_up(GTK_IMHTML(gtkconv->imhtml));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case GDK_Page_Down:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_page_down(GTK_IMHTML(gtkconv->imhtml));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /*
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * NOTE:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * This guy just kills a single right click from being propagated any
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * further. I have no idea *why* we need this, but we do ... It
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * prevents right clicks on the GtkTextView in a convo dialog from
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * going all the way down to the notebook. I suspect a bug in
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * GtkTextView, but I'm not ready to point any fingers yet.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 entry_stop_rclick_cb(GtkWidget *widget, GdkEventButton *event, gpointer data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (event->button == 3 && event->type == GDK_BUTTON_PRESS) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Right single click */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_stop_emission_by_name(G_OBJECT(widget), "button_press_event");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /*
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * If someone tries to type into the conversation backlog of a
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * conversation window then we yank focus from the conversation backlog
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * and give it to the text entry box so that people can type
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * all the live long day and it will get entered into the entry box.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 refocus_entry_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv = data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* If we have a valid key for the conversation display, then exit */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((event->state & GDK_CONTROL_MASK) ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (event->keyval == GDK_F6) ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (event->keyval == GDK_F10) ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (event->keyval == GDK_Shift_L) ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (event->keyval == GDK_Shift_R) ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (event->keyval == GDK_Control_L) ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (event->keyval == GDK_Control_R) ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (event->keyval == GDK_Escape) ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (event->keyval == GDK_Up) ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (event->keyval == GDK_Down) ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (event->keyval == GDK_Left) ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (event->keyval == GDK_Right) ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (event->keyval == GDK_Page_Up) ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (event->keyval == GDK_Page_Down) ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (event->keyval == GDK_Home) ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (event->keyval == GDK_End) ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (event->keyval == GDK_Tab) ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (event->keyval == GDK_ISO_Left_Tab))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (event->type == GDK_KEY_PRESS)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return conv_keypress_common(gtkconv, event);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (event->type == GDK_KEY_RELEASE)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_grab_focus(gtkconv->entry);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_event(gtkconv->entry, (GdkEvent *)event);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 regenerate_options_items(PidginWindow *win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_switch_active_conversation(PurpleConversation *conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *old_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkIMHtml *entry;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *protocol_name;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(conv != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 old_conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (old_conv == conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_close_logs(old_conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->active_conv = conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_set_logging(conv,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(gtkconv->win->menu.logging)));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 entry = GTK_IMHTML(gtkconv->entry);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 protocol_name = purple_account_get_protocol_name(conv->account);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_set_protocol_name(entry, protocol_name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_set_protocol_name(GTK_IMHTML(gtkconv->imhtml), protocol_name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!(conv->features & PURPLE_CONNECTION_HTML))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_clear_formatting(GTK_IMHTML(gtkconv->entry));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (conv->features & PURPLE_CONNECTION_FORMATTING_WBFO &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 !(old_conv->features & PURPLE_CONNECTION_FORMATTING_WBFO))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* The old conversation allowed formatting on parts of the
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * buffer, but the new one only allows it on the whole
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * buffer. This code saves the formatting from the current
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * position of the cursor, clears the formatting, then
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * applies the saved formatting to the entire buffer. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean bold;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean italic;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean underline;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *fontface = gtk_imhtml_get_current_fontface(entry);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *forecolor = gtk_imhtml_get_current_forecolor(entry);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *backcolor = gtk_imhtml_get_current_backcolor(entry);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *background = gtk_imhtml_get_current_background(entry);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gint fontsize = gtk_imhtml_get_current_fontsize(entry);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean bold2;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean italic2;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean underline2;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_get_current_format(entry, &bold, &italic, &underline);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Clear existing formatting */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_clear_formatting(entry);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Apply saved formatting to the whole buffer. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_get_current_format(entry, &bold2, &italic2, &underline2);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (bold != bold2)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_toggle_bold(entry);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (italic != italic2)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_toggle_italic(entry);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (underline != underline2)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_toggle_underline(entry);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_toggle_fontface(entry, fontface);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!(conv->features & PURPLE_CONNECTION_NO_FONTSIZE))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_font_set_size(entry, fontsize);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_toggle_forecolor(entry, forecolor);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!(conv->features & PURPLE_CONNECTION_NO_BGCOLOR))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_toggle_backcolor(entry, backcolor);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_toggle_background(entry, background);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(fontface);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(forecolor);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(backcolor);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(background);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* This is done in default_formatize, which is called from clear_formatting_cb,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * which is (obviously) a clear_formatting signal handler. However, if we're
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * here, we didn't call gtk_imhtml_clear_formatting() (because we want to
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * preserve the formatting exactly as it is), so we have to do this now. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_set_whole_buffer_formatting_only(entry,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (conv->features & PURPLE_CONNECTION_FORMATTING_WBFO));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_emit(pidgin_conversations_get_handle(), "conversation-switched", conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gray_stuff_out(gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 update_typing_icon(gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set_data(G_OBJECT(entry), "transient_buddy", NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 regenerate_options_items(gtkconv->win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_window_set_title(GTK_WINDOW(gtkconv->win->window),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_label_get_text(GTK_LABEL(gtkconv->tab_label)));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu_conv_sel_send_cb(GObject *m, gpointer data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleAccount *account = g_object_get_data(m, "purple_account");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gchar *name = g_object_get_data(m, "purple_buddy_name");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtk_check_menu_item_get_active((GtkCheckMenuItem*) m) == FALSE)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_switch_active_conversation(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 insert_text_cb(GtkTextBuffer *textbuffer, GtkTextIter *position,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gchar *new_text, gint new_text_length, gpointer user_data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv = (PidginConversation *)user_data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(gtkconv != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!purple_prefs_get_bool("/purple/conversations/im/send_typing"))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 got_typing_keypress(gtkconv, (gtk_text_iter_is_start(position) &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_iter_is_end(position)));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 delete_text_cb(GtkTextBuffer *textbuffer, GtkTextIter *start_pos,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTextIter *end_pos, gpointer user_data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv = (PidginConversation *)user_data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConvIm *im;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(gtkconv != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!purple_prefs_get_bool("/purple/conversations/im/send_typing"))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 im = PURPLE_CONV_IM(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtk_text_iter_is_start(start_pos) && gtk_text_iter_is_end(end_pos)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* We deleted all the text, so turn off typing. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conv_im_stop_send_typed_timeout(im);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 serv_send_typing(purple_conversation_get_gc(conv),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_get_name(conv),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_NOT_TYPING);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* We're deleting, but not all of it, so it counts as typing. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 got_typing_keypress(gtkconv, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /**************************************************************************
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * A bunch of buddy icon functions
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 **************************************************************************/
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GList *get_prpl_icon_list(PurpleAccount *account)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *l = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurplePlugin *prpl = purple_find_prpl(purple_account_get_protocol_id(account));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurplePluginProtocolInfo *prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *prplname = prpl_info->list_icon(account, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 l = g_hash_table_lookup(prpl_lists, prplname);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (l)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return l;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 l = g_list_prepend(l, pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_LARGE));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 l = g_list_prepend(l, pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_MEDIUM));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 l = g_list_prepend(l, pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_SMALL));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_hash_table_insert(prpl_lists, g_strdup(prplname), l);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return l;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GList *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_get_tab_icons(PurpleConversation *conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleAccount *account = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *name = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_val_if_fail(conv != NULL, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 account = purple_conversation_get_account(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 name = purple_conversation_get_name(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_val_if_fail(account != NULL, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_val_if_fail(name != NULL, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Use the buddy icon, if possible */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBuddy *b = purple_find_buddy(account, name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (b != NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurplePresence *p;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 p = purple_buddy_get_presence(b);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_AWAY))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return away_list;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_UNAVAILABLE))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return busy_list;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_EXTENDED_AWAY))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return xa_list;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_OFFLINE))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return offline_list;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return available_list;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return get_prpl_icon_list(account);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GdkPixbuf *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_get_icon(PurpleConversation *conv, GtkWidget *parent, const char *icon_size)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleAccount *account = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *name = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkPixbuf *status = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBlistUiOps *ops = purple_blist_get_ui_ops();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_val_if_fail(conv != NULL, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 account = purple_conversation_get_account(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 name = purple_conversation_get_name(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_val_if_fail(account != NULL, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_val_if_fail(name != NULL, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Use the buddy icon, if possible */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBuddy *b = purple_find_buddy(account, name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (b != NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurplePresence *p = purple_buddy_get_presence(b);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* I hate this hack. It fixes a bug where the pending message icon
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * displays in the conv tab even though it shouldn't.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * A better solution would be great. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (ops && ops->update)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ops->update(NULL, (PurpleBlistNode*)b);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* XXX Seanegan: We really need a util function to return a pixbuf for a Presence to avoid all this switching */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_AWAY))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 status = pidgin_create_status_icon(PURPLE_STATUS_AWAY, parent, icon_size);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_EXTENDED_AWAY))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 status = pidgin_create_status_icon(PURPLE_STATUS_EXTENDED_AWAY, parent, icon_size);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_OFFLINE))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 status = pidgin_create_status_icon(PURPLE_STATUS_OFFLINE, parent, icon_size);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_AVAILABLE))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 status = pidgin_create_status_icon(PURPLE_STATUS_AVAILABLE, parent, icon_size);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_INVISIBLE))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 status = pidgin_create_status_icon(PURPLE_STATUS_INVISIBLE, parent, icon_size);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_UNAVAILABLE))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 status = pidgin_create_status_icon(PURPLE_STATUS_UNAVAILABLE, parent, icon_size);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* If they don't have a buddy icon, then use the PRPL icon */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (status == NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkIconSize size = gtk_icon_size_from_name(icon_size);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 status = gtk_widget_render_icon (parent, PIDGIN_STOCK_STATUS_PERSON,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 size, "GtkWidget");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 status = gtk_widget_render_icon (parent, PIDGIN_STOCK_STATUS_CHAT,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 size, "GtkWidget");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return status;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkPixbuf *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_get_tab_icon(PurpleConversation *conv, gboolean small_icon)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *icon_size = small_icon ? PIDGIN_ICON_SIZE_TANGO_MICROSCOPIC : PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return pidgin_conv_get_icon(conv, PIDGIN_CONVERSATION(conv)->icon, icon_size);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 update_tab_icon(PurpleConversation *conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *l;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkPixbuf *status = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkPixbuf *infopane_status = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkPixbuf *emblem = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(conv != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win = gtkconv->win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (conv != gtkconv->active_conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 status = pidgin_conv_get_tab_icon(conv, TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 infopane_status = pidgin_conv_get_tab_icon(conv, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBuddy *b = purple_find_buddy(conv->account, conv->name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (b)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 emblem = pidgin_blist_get_emblem((PurpleBlistNode*)b);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleChat *c = purple_blist_find_chat(conv->account, conv->name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (c)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 emblem = pidgin_blist_get_emblem((PurpleBlistNode*)c);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(status != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_image_set_from_pixbuf(GTK_IMAGE(gtkconv->icon), status);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_image_set_from_pixbuf(GTK_IMAGE(gtkconv->menu_icon), status);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_list_store_set(GTK_LIST_STORE(gtkconv->infopane_model),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 &(gtkconv->infopane_iter),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CONV_ICON_COLUMN, infopane_status, -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_list_store_set(GTK_LIST_STORE(gtkconv->infopane_model),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 &(gtkconv->infopane_iter),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CONV_EMBLEM_COLUMN, emblem, -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (emblem)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_unref(emblem);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons")) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 emblem = pidgin_create_prpl_icon(gtkconv->active_conv->account, PIDGIN_PRPL_ICON_SMALL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_list_store_set(GTK_LIST_STORE(gtkconv->infopane_model),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 &(gtkconv->infopane_iter),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CONV_PROTOCOL_ICON_COLUMN, emblem, -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (emblem)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_unref(emblem);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* XXX seanegan Why do I have to do this? */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_queue_draw(gtkconv->infopane);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (status != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_unref(status);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (pidgin_conv_window_is_active_conversation(conv) &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (purple_conversation_get_type(conv) != PURPLE_CONV_TYPE_IM ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->u.im->anim == NULL))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 l = pidgin_conv_get_tab_icons(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_window_set_icon_list(GTK_WINDOW(win->window), l);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* This gets added as an idle handler when doing something that
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * redraws the icon. It sets the auto_resize gboolean to TRUE.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * This way, when the size_allocate callback gets triggered, it notices
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * that this is an autoresize, and after the main loop iterates, it
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * gets set back to FALSE
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean reset_auto_resize_cb(gpointer data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv = (PidginConversation *)data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->auto_resize = FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 redraw_icon(gpointer data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv = (PidginConversation *)data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleAccount *account;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurplePluginProtocolInfo *prpl_info = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkPixbuf *buf;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkPixbuf *scale;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gint delay;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int scale_width, scale_height;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 account = purple_conversation_get_account(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(account && account->gc) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(account->gc->prpl);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->u.im->icon_timer = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gdk_pixbuf_animation_iter_advance(gtkconv->u.im->iter, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buf = gdk_pixbuf_animation_iter_get_pixbuf(gtkconv->u.im->iter);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 scale_width = gdk_pixbuf_get_width(buf);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 scale_height = gdk_pixbuf_get_height(buf);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (scale_width == scale_height) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 scale_width = scale_height = 32;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (scale_height > scale_width) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 scale_width = 32 * scale_width / scale_height;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 scale_height = 32;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 scale_height = 32 * scale_height / scale_width;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 scale_width = 32;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 scale = gdk_pixbuf_scale_simple(buf, scale_width, scale_height,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GDK_INTERP_BILINEAR);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (pidgin_gdk_pixbuf_is_opaque(scale))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_gdk_pixbuf_make_round(scale);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_image_set_from_pixbuf(GTK_IMAGE(gtkconv->u.im->icon), scale);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_unref(G_OBJECT(scale));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_queue_draw(gtkconv->u.im->icon);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 delay = gdk_pixbuf_animation_iter_get_delay_time(gtkconv->u.im->iter);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (delay < 100)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 delay = 100;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->u.im->icon_timer = g_timeout_add(delay, redraw_icon, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 start_anim(GtkObject *obj, PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int delay;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->u.im->anim == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->u.im->icon_timer != 0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gdk_pixbuf_animation_is_static_image(gtkconv->u.im->anim))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 delay = gdk_pixbuf_animation_iter_get_delay_time(gtkconv->u.im->iter);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (delay < 100)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 delay = 100;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->u.im->icon_timer = g_timeout_add(delay, redraw_icon, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 remove_icon(GtkWidget *widget, PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *gtkwin;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(conv != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->u.im->icon_container != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_destroy(gtkconv->u.im->icon_container);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->u.im->anim != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_unref(G_OBJECT(gtkconv->u.im->anim));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->u.im->icon_timer != 0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_source_remove(gtkconv->u.im->icon_timer);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->u.im->iter != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_unref(G_OBJECT(gtkconv->u.im->iter));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->u.im->icon_timer = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->u.im->icon = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->u.im->anim = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->u.im->iter = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->u.im->icon_container = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->u.im->show_icon = FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkwin = gtkconv->win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 saveicon_writefile_cb(void *user_data, const char *filename)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv = (PidginConversation *)user_data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 FILE *fp;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBuddyIcon *icon;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const void *data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 size_t len;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((fp = g_fopen(filename, "wb")) == NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_notify_error(gtkconv, NULL, _("Unable to open file."), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 icon = purple_conv_im_get_icon(PURPLE_CONV_IM(conv));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 data = purple_buddy_icon_get_data(icon, &len);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((len <= 0) || (data == NULL) || (fwrite(data, 1, len, fp) != len)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_notify_error(gtkconv, NULL, _("Unable to save icon file to disk."), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 fclose(fp);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_unlink(filename);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 fclose(fp);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 custom_icon_sel_cb(const char *filename, gpointer data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (filename) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv = data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleAccount *account = purple_conversation_get_account(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_set_custom_buddy_icon(account, purple_conversation_get_name(conv), filename);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 set_custom_icon_cb(GtkWidget *widget, PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *win = pidgin_buddy_icon_chooser_new(GTK_WINDOW(gtkconv->win->window),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 custom_icon_sel_cb, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show_all(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 remove_custom_icon_cb(GtkWidget *widget, PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleAccount *account;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 account = purple_conversation_get_account(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_set_custom_buddy_icon(account, purple_conversation_get_name(conv), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 icon_menu_save_cb(GtkWidget *widget, PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const gchar *ext;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gchar *buf;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(conv != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ext = purple_buddy_icon_get_extension(purple_conv_im_get_icon(PURPLE_CONV_IM(conv)));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buf = g_strdup_printf("%s.%s", purple_normalize(conv->account, conv->name), ext);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_request_file(gtkconv, _("Save Icon"), buf, TRUE,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(saveicon_writefile_cb), NULL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv->account, NULL, conv,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(buf);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 stop_anim(GtkObject *obj, PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->u.im->icon_timer != 0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_source_remove(gtkconv->u.im->icon_timer);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->u.im->icon_timer = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 toggle_icon_animate_cb(GtkWidget *w, PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->u.im->animate =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->u.im->animate)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 start_anim(NULL, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 stop_anim(NULL, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 icon_menu(GtkObject *obj, GdkEventButton *e, PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GtkWidget *menu = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBuddy *buddy;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (e->button != 3 || e->type != GDK_BUTTON_PRESS)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /*
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * If a menu already exists, destroy it before creating a new one,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * thus freeing-up the memory it occupied.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (menu != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_destroy(menu);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu = gtk_menu_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->u.im->anim &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 !(gdk_pixbuf_animation_is_static_image(gtkconv->u.im->anim)))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_new_check_item(menu, _("Animate"),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(toggle_icon_animate_cb), gtkconv,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->u.im->icon_timer);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_new_item_from_stock(menu, _("Hide Icon"), NULL, G_CALLBACK(remove_icon),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv, 0, 0, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_new_item_from_stock(menu, _("Save Icon As..."), GTK_STOCK_SAVE_AS,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(icon_menu_save_cb), gtkconv,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 0, 0, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_new_item_from_stock(menu, _("Set Custom Icon..."), NULL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(set_custom_icon_cb), gtkconv,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 0, 0, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Is there a custom icon for this person? */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buddy = purple_find_buddy(purple_conversation_get_account(conv),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_get_name(conv));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (buddy)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleContact *contact = purple_buddy_get_contact(buddy);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (contact && purple_buddy_icons_has_custom_icon(contact))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_new_item_from_stock(menu, _("Remove Custom Icon"), NULL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(remove_custom_icon_cb), gtkconv,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 0, 0, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, e->button, e->time);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /**************************************************************************
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * End of the bunch of buddy icon functions
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 **************************************************************************/
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_present_conversation(PurpleConversation *conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkModifierType state;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv == NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_attach_to_conversation(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (gtkconv->win == hidden_convwin) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_remove_gtkconv(hidden_convwin, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_placement_place(gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_switch_active_conversation(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Switch the tab only if the user initiated the event by pressing
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * a button or hitting a key. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtk_get_current_event_state(&state))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_switch_gtkconv(gtkconv->win, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_window_present(GTK_WINDOW(gtkconv->win->window));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conversations_find_unseen_list(PurpleConversationType type,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginUnseenState min_state,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean hidden_only,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 guint max_count)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *l;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *r = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 guint c = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (type == PURPLE_CONV_TYPE_IM) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 l = purple_get_ims();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (type == PURPLE_CONV_TYPE_CHAT) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 l = purple_get_chats();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 l = purple_get_conversations();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (; l != NULL && (max_count == 0 || c < max_count); l = l->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = (PurpleConversation*)l->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(gtkconv == NULL || gtkconv->active_conv != conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 continue;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->unseen_state >= min_state
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 && (!hidden_only ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (hidden_only && gtkconv->win == hidden_convwin))) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 r = g_list_prepend(r, conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 c++;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return r;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 unseen_conv_menu_cb(GtkMenuItem *item, PurpleConversation *conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(conv != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_present_conversation(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 unseen_all_conv_menu_cb(GtkMenuItem *item, GList *list)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(list != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Do not free the list from here. It will be freed from the
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * 'destroy' callback on the menuitem. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 while (list) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_present_conversation(list->data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 list = list->next;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 guint
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conversations_fill_menu(GtkWidget *menu, GList *convs)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *l;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 guint ret=0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_val_if_fail(menu != NULL, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_val_if_fail(convs != NULL, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (l = convs; l != NULL ; l = l->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = (PurpleConversation*)l->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *icon = gtk_image_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkPixbuf *pbuf = pidgin_conv_get_icon(conv, icon, PIDGIN_ICON_SIZE_TANGO_MICROSCOPIC);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *item;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gchar *text = g_strdup_printf("%s (%d)",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_label_get_text(GTK_LABEL(gtkconv->tab_label)),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->unseen_count);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_image_set_from_pixbuf(GTK_IMAGE(icon), pbuf);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_unref(pbuf);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 item = gtk_image_menu_item_new_with_label(text);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), icon);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(item), "activate", G_CALLBACK(unseen_conv_menu_cb), conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(text);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ret++;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (convs->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* There are more than one conversation. Add an option to show all conversations. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *item;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *list = g_list_copy(convs);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_separator(menu);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 item = gtk_menu_item_new_with_label(_("Show All"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(item), "activate", G_CALLBACK(unseen_all_conv_menu_cb), list);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect_swapped(G_OBJECT(item), "destroy", G_CALLBACK(g_list_free), list);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return ret;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_get_window(PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_val_if_fail(gtkconv != NULL, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return gtkconv->win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GtkItemFactoryEntry menu_items[] =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Conversation menu */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 { N_("/_Conversation"), NULL, NULL, 0, "<Branch>", NULL },
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 { N_("/Conversation/New Instant _Message..."), "<CTL>M", menu_new_conv_cb,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 0, "<StockItem>", PIDGIN_STOCK_TOOLBAR_MESSAGE_NEW },
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 { "/Conversation/sep0", NULL, NULL, 0, "<Separator>", NULL },
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 { N_("/Conversation/_Find..."), NULL, menu_find_cb, 0,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "<StockItem>", GTK_STOCK_FIND },
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 { N_("/Conversation/View _Log"), NULL, menu_view_log_cb, 0, "<Item>", NULL },
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 { N_("/Conversation/_Save As..."), NULL, menu_save_as_cb, 0,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "<StockItem>", GTK_STOCK_SAVE_AS },
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 { N_("/Conversation/Clea_r Scrollback"), "<CTL>L", menu_clear_cb, 0, "<StockItem>", GTK_STOCK_CLEAR },
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 { "/Conversation/sep1", NULL, NULL, 0, "<Separator>", NULL },
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 { N_("/Conversation/Se_nd File..."), NULL, menu_send_file_cb, 0, "<StockItem>", PIDGIN_STOCK_TOOLBAR_SEND_FILE },
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 { N_("/Conversation/Add Buddy _Pounce..."), NULL, menu_add_pounce_cb,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 0, "<Item>", NULL },
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 { N_("/Conversation/_Get Info"), "<CTL>O", menu_get_info_cb, 0,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "<StockItem>", PIDGIN_STOCK_TOOLBAR_USER_INFO },
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 { N_("/Conversation/In_vite..."), NULL, menu_invite_cb, 0,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "<Item>", NULL },
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 { N_("/Conversation/M_ore"), NULL, NULL, 0, "<Branch>", NULL },
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 { "/Conversation/sep2", NULL, NULL, 0, "<Separator>", NULL },
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 { N_("/Conversation/Al_ias..."), NULL, menu_alias_cb, 0,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "<Item>", NULL },
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 { N_("/Conversation/_Block..."), NULL, menu_block_cb, 0,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "<StockItem>", PIDGIN_STOCK_TOOLBAR_BLOCK },
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 { N_("/Conversation/_Unblock..."), NULL, menu_unblock_cb, 0,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "<StockItem>", PIDGIN_STOCK_TOOLBAR_UNBLOCK },
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 { N_("/Conversation/_Add..."), NULL, menu_add_remove_cb, 0,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "<StockItem>", GTK_STOCK_ADD },
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 { N_("/Conversation/_Remove..."), NULL, menu_add_remove_cb, 0,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "<StockItem>", GTK_STOCK_REMOVE },
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 { "/Conversation/sep3", NULL, NULL, 0, "<Separator>", NULL },
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 { N_("/Conversation/Insert Lin_k..."), NULL, menu_insert_link_cb, 0,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "<StockItem>", PIDGIN_STOCK_TOOLBAR_INSERT_LINK },
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 { N_("/Conversation/Insert Imag_e..."), NULL, menu_insert_image_cb, 0,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "<StockItem>", PIDGIN_STOCK_TOOLBAR_INSERT_IMAGE },
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 { "/Conversation/sep4", NULL, NULL, 0, "<Separator>", NULL },
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 { N_("/Conversation/_Close"), NULL, menu_close_conv_cb, 0,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "<StockItem>", GTK_STOCK_CLOSE },
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Options */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 { N_("/_Options"), NULL, NULL, 0, "<Branch>", NULL },
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 { N_("/Options/Enable _Logging"), NULL, menu_logging_cb, 0, "<CheckItem>", NULL },
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 { N_("/Options/Enable _Sounds"), NULL, menu_sounds_cb, 0, "<CheckItem>", NULL },
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 { "/Options/sep0", NULL, NULL, 0, "<Separator>", NULL },
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 { N_("/Options/Show Formatting _Toolbars"), NULL, menu_toolbar_cb, 0, "<CheckItem>", NULL },
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 { N_("/Options/Show Ti_mestamps"), "F2", menu_timestamps_cb, 0, "<CheckItem>", NULL },
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 };
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static const int menu_item_count =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 sizeof(menu_items) / sizeof(*menu_items);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static const char *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 item_factory_translate_func (const char *path, gpointer func_data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return _(path);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 sound_method_pref_changed_cb(const char *name, PurplePrefType type,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gconstpointer value, gpointer data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win = data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *method = value;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!strcmp(method, "none"))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(win->menu.sounds),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(win->menu.sounds, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv = pidgin_conv_window_get_active_gtkconv(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(win->menu.sounds),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->make_sound);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(win->menu.sounds, TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Returns TRUE if some items were added to the menu, FALSE otherwise */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 populate_menu_with_options(GtkWidget *menu, PidginConversation *gtkconv, gboolean all)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *list;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBlistNode *node = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleChat *chat = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBuddy *buddy = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean ret;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 chat = purple_blist_find_chat(conv->account, conv->name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((chat == NULL) && (gtkconv->imhtml != NULL)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 chat = g_object_get_data(G_OBJECT(gtkconv->imhtml), "transient_chat");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((chat == NULL) && (gtkconv->imhtml != NULL)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GHashTable *components;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 components = g_hash_table_new_full(g_str_hash, g_str_equal,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free, g_free);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_hash_table_replace(components, g_strdup("channel"),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_strdup(conv->name));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 chat = purple_chat_new(conv->account, NULL, components);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_blist_node_set_flags((PurpleBlistNode *)chat,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_BLIST_NODE_FLAG_NO_SAVE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set_data_full(G_OBJECT(gtkconv->imhtml), "transient_chat",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 chat, (GDestroyNotify)purple_blist_remove_chat);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!purple_account_is_connected(conv->account))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buddy = purple_find_buddy(conv->account, conv->name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* gotta remain bug-compatible :( libpurple < 2.0.2 didn't handle
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * removing "isolated" buddy nodes well */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_version_check(2, 0, 2) == NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((buddy == NULL) && (gtkconv->imhtml != NULL)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buddy = g_object_get_data(G_OBJECT(gtkconv->imhtml), "transient_buddy");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((buddy == NULL) && (gtkconv->imhtml != NULL)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buddy = purple_buddy_new(conv->account, conv->name, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_blist_node_set_flags((PurpleBlistNode *)buddy,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_BLIST_NODE_FLAG_NO_SAVE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set_data_full(G_OBJECT(gtkconv->imhtml), "transient_buddy",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buddy, (GDestroyNotify)purple_blist_remove_buddy);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (chat)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 node = (PurpleBlistNode *)chat;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (buddy)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 node = (PurpleBlistNode *)buddy;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Now add the stuff */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (all) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (buddy)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_blist_make_buddy_menu(menu, buddy, TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (chat) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* XXX: */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (node) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_account_is_connected(conv->account))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_append_blist_node_proto_menu(menu, conv->account->gc, node);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_append_blist_node_extended_menu(menu, node);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((list = gtk_container_get_children(GTK_CONTAINER(menu))) == NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ret = FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_list_free(list);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ret = TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return ret;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 regenerate_options_items(PidginWindow *win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *menu;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *list;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = pidgin_conv_window_get_active_gtkconv(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu = gtk_item_factory_get_widget(win->menu.item_factory, N_("/Conversation/More"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Remove the previous entries */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (list = gtk_container_get_children(GTK_CONTAINER(menu)); list; )
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *w = list->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 list = g_list_delete_link(list, list);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_destroy(w);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!populate_menu_with_options(menu, gtkconv, FALSE))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *item = gtk_menu_item_new_with_label(_("No actions available"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(item, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show_all(menu);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 remove_from_list(GtkWidget *widget, PidginWindow *win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *list = g_object_get_data(G_OBJECT(win->window), "plugin-actions");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 list = g_list_remove(list, widget);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set_data(G_OBJECT(win->window), "plugin-actions", list);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 regenerate_plugins_items(PidginWindow *win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *action_items;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *menu;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *list;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *item;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (win->window == NULL || win == hidden_convwin)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = pidgin_conv_window_get_active_gtkconv(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 action_items = g_object_get_data(G_OBJECT(win->window), "plugin-actions");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Remove the old menuitems */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 while (action_items) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_handlers_disconnect_by_func(G_OBJECT(action_items->data),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(remove_from_list), win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_destroy(action_items->data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 action_items = g_list_delete_link(action_items, action_items);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu = gtk_item_factory_get_widget(win->menu.item_factory, N_("/Options"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 list = purple_conversation_get_extended_menu(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (list) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 action_items = g_list_prepend(NULL, (item = pidgin_separator(menu)));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(item), "destroy", G_CALLBACK(remove_from_list), win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for(; list; list = g_list_delete_link(list, list)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleMenuAction *act = (PurpleMenuAction *) list->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 item = pidgin_append_menu_action(menu, act, conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 action_items = g_list_prepend(action_items, item);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show_all(item);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(item), "destroy", G_CALLBACK(remove_from_list), win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set_data(G_OBJECT(win->window), "plugin-actions", action_items);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void menubar_activated(GtkWidget *item, gpointer data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win = data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 regenerate_options_items(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 regenerate_plugins_items(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* The following are to make sure the 'More' submenu is not regenerated every time
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * the focus shifts from 'Conversations' to some other menu and back. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_handlers_block_by_func(G_OBJECT(item), G_CALLBACK(menubar_activated), data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(win->menu.menubar), "deactivate", G_CALLBACK(focus_out_from_menubar), data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 focus_out_from_menubar(GtkWidget *wid, PidginWindow *win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* The menubar has been deactivated. Make sure the 'More' submenu is regenerated next time
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * the 'Conversation' menu pops up. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *menuitem = gtk_item_factory_get_item(win->menu.item_factory, N_("/Conversation"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_handlers_unblock_by_func(G_OBJECT(menuitem), G_CALLBACK(menubar_activated), win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_handlers_disconnect_by_func(G_OBJECT(win->menu.menubar),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(focus_out_from_menubar), win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GtkWidget *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 setup_menubar(PidginWindow *win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkAccelGroup *accel_group;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *method;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *menuitem;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 accel_group = gtk_accel_group_new ();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_window_add_accel_group(GTK_WINDOW(win->window), accel_group);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_unref(accel_group);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->menu.item_factory =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_item_factory_new(GTK_TYPE_MENU_BAR, "<main>", accel_group);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_item_factory_set_translate_func(win->menu.item_factory,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (GtkTranslateFunc)item_factory_translate_func,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 NULL, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_item_factory_create_items(win->menu.item_factory, menu_item_count,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu_items, win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(accel_group), "accel-changed",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(pidgin_save_accels_cb), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Make sure the 'Conversation -> More' menuitems are regenerated whenever
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * the 'Conversation' menu pops up because the entries can change after the
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * conversation is created. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menuitem = gtk_item_factory_get_item(win->menu.item_factory, N_("/Conversation"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(menuitem), "activate", G_CALLBACK(menubar_activated), win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->menu.menubar =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_item_factory_get_widget(win->menu.item_factory, "<main>");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->menu.view_log =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_item_factory_get_widget(win->menu.item_factory,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 N_("/Conversation/View Log"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* --- */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->menu.send_file =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_item_factory_get_widget(win->menu.item_factory,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 N_("/Conversation/Send File..."));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->menu.add_pounce =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_item_factory_get_widget(win->menu.item_factory,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 N_("/Conversation/Add Buddy Pounce..."));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* --- */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->menu.get_info =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_item_factory_get_widget(win->menu.item_factory,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 N_("/Conversation/Get Info"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->menu.invite =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_item_factory_get_widget(win->menu.item_factory,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 N_("/Conversation/Invite..."));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* --- */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->menu.alias =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_item_factory_get_widget(win->menu.item_factory,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 N_("/Conversation/Alias..."));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->menu.block =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_item_factory_get_widget(win->menu.item_factory,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 N_("/Conversation/Block..."));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->menu.unblock =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_item_factory_get_widget(win->menu.item_factory,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 N_("/Conversation/Unblock..."));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->menu.add =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_item_factory_get_widget(win->menu.item_factory,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 N_("/Conversation/Add..."));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->menu.remove =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_item_factory_get_widget(win->menu.item_factory,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 N_("/Conversation/Remove..."));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* --- */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->menu.insert_link =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_item_factory_get_widget(win->menu.item_factory,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 N_("/Conversation/Insert Link..."));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->menu.insert_image =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_item_factory_get_widget(win->menu.item_factory,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 N_("/Conversation/Insert Image..."));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* --- */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->menu.logging =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_item_factory_get_widget(win->menu.item_factory,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 N_("/Options/Enable Logging"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->menu.sounds =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_item_factory_get_widget(win->menu.item_factory,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 N_("/Options/Enable Sounds"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 method = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (method != NULL && !strcmp(method, "none"))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(win->menu.sounds),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(win->menu.sounds, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_connect_callback(win, PIDGIN_PREFS_ROOT "/sound/method",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 sound_method_pref_changed_cb, win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->menu.show_formatting_toolbar =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_item_factory_get_widget(win->menu.item_factory,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 N_("/Options/Show Formatting Toolbars"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->menu.show_timestamps =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_item_factory_get_widget(win->menu.item_factory,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 N_("/Options/Show Timestamps"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->menu.show_icon = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->menu.tray = pidgin_menu_tray_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_menu_shell_append(GTK_MENU_SHELL(win->menu.menubar),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->menu.tray);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(win->menu.tray);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(win->menu.menubar);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return win->menu.menubar;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /**************************************************************************
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * Utility functions
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 **************************************************************************/
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 got_typing_keypress(PidginConversation *gtkconv, gboolean first)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConvIm *im;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /*
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * We know we got something, so we at least have to make sure we don't
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * send PURPLE_TYPED any time soon.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 im = PURPLE_CONV_IM(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conv_im_stop_send_typed_timeout(im);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conv_im_start_send_typed_timeout(im);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Check if we need to send another PURPLE_TYPING message */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (first || (purple_conv_im_get_type_again(im) != 0 &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 time(NULL) > purple_conv_im_get_type_again(im)))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 unsigned int timeout;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 timeout = serv_send_typing(purple_conversation_get_gc(conv),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_get_name(conv),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_TYPING);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conv_im_set_type_again(im, timeout);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #if 0
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 typing_animation(gpointer data) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv = data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *gtkwin = gtkconv->win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *stock_id = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(gtkconv != pidgin_conv_window_get_active_gtkconv(gtkwin)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 switch (rand() % 5) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case 0:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 stock_id = PIDGIN_STOCK_ANIMATION_TYPING0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case 1:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 stock_id = PIDGIN_STOCK_ANIMATION_TYPING1;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case 2:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 stock_id = PIDGIN_STOCK_ANIMATION_TYPING2;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case 3:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 stock_id = PIDGIN_STOCK_ANIMATION_TYPING3;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case 4:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 stock_id = PIDGIN_STOCK_ANIMATION_TYPING4;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkwin->menu.typing_icon == NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkwin->menu.typing_icon = gtk_image_new_from_stock(stock_id, GTK_ICON_SIZE_MENU);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_menu_tray_append(PIDGIN_MENU_TRAY(gtkwin->menu.tray),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkwin->menu.typing_icon,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 _("User is typing..."));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_image_set_from_stock(GTK_IMAGE(gtkwin->menu.typing_icon), stock_id, GTK_ICON_SIZE_MENU);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(gtkwin->menu.typing_icon);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 update_typing_message(PidginConversation *gtkconv, const char *message)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->imhtml));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTextMark *stmark, *enmark;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 stmark = gtk_text_buffer_get_mark(buffer, "typing-notification-start");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 enmark = gtk_text_buffer_get_mark(buffer, "typing-notification-end");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (stmark && enmark) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTextIter start, end;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_get_iter_at_mark(buffer, &start, stmark);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_get_iter_at_mark(buffer, &end, enmark);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_delete_mark(buffer, stmark);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_delete_mark(buffer, enmark);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_delete(buffer, &start, &end);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (message && *message == '\n' && !*(message + 1))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 message = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (message) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTextIter iter;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_get_end_iter(buffer, &iter);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_create_mark(buffer, "typing-notification-start", &iter, TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, message, -1, "TYPING-NOTIFICATION", NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_get_end_iter(buffer, &iter);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_create_mark(buffer, "typing-notification-end", &iter, TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 update_typing_icon(PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *gtkwin;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConvIm *im = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *message = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkwin = gtkconv->win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 im = PURPLE_CONV_IM(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (im == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conv_im_get_typing_state(im) == PURPLE_NOT_TYPING) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 update_typing_message(gtkconv, "\n");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conv_im_get_typing_state(im) == PURPLE_TYPING) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 message = g_strdup_printf(_("\n%s is typing..."), purple_conversation_get_title(conv));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 message = g_strdup_printf(_("\n%s has stopped typing"), purple_conversation_get_title(conv));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 update_typing_message(gtkconv, message);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(message);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 update_send_to_selection(PidginWindow *win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleAccount *account;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *menu;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *child;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBuddy *b;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = pidgin_conv_window_get_active_conversation(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (conv == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 account = purple_conversation_get_account(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (account == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (win->menu.send_to == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!(b = purple_find_buddy(account, conv->name)))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(win->menu.send_to);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(win->menu.send_to));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (child = gtk_container_get_children(GTK_CONTAINER(menu));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 child != NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 child = g_list_delete_link(child, child)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *item = child->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBuddy *item_buddy;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleAccount *item_account = g_object_get_data(G_OBJECT(item), "purple_account");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gchar *buddy_name = g_object_get_data(G_OBJECT(item),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "purple_buddy_name");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 item_buddy = purple_find_buddy(item_account, buddy_name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (b == item_buddy) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_list_free(child);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 send_to_item_enter_notify_cb(GtkWidget *menuitem, GdkEventCrossing *event, GtkWidget *label)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(GTK_WIDGET(label), TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 send_to_item_leave_notify_cb(GtkWidget *menuitem, GdkEventCrossing *event, GtkWidget *label)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 create_sendto_item(GtkWidget *menu, GtkSizeGroup *sg, GSList **group, PurpleBuddy *buddy, PurpleAccount *account, const char *name)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *box;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *label;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *image;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *menuitem;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkPixbuf *pixbuf;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gchar *text;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Create a pixmap for the protocol icon. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pixbuf = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_SMALL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Now convert it to GtkImage */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (pixbuf == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 image = gtk_image_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 image = gtk_image_new_from_pixbuf(pixbuf);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_unref(G_OBJECT(pixbuf));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_size_group_add_widget(sg, image);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Make our menu item */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 text = g_strdup_printf("%s (%s)", name, purple_account_get_username(account));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menuitem = gtk_radio_menu_item_new_with_label(*group, text);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(text);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 *group = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(menuitem));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Do some evil, see some evil, speak some evil. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 box = gtk_hbox_new(FALSE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 label = gtk_bin_get_child(GTK_BIN(menuitem));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_ref(label);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_container_remove(GTK_CONTAINER(menuitem), label);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(box), image, FALSE, FALSE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(box), label, TRUE, TRUE, 4);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (buddy != NULL &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 !purple_presence_is_online(purple_buddy_get_presence(buddy)) &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 !purple_account_supports_offline_message(account, buddy))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(label, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Set the label sensitive when the menuitem is highlighted and
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * insensitive again when the mouse leaves it. This way, it
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * doesn't appear weird from the highlighting of the embossed
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * (insensitive style) text.*/
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(menuitem, "enter-notify-event",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(send_to_item_enter_notify_cb), label);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(menuitem, "leave-notify-event",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(send_to_item_leave_notify_cb), label);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_unref(label);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_container_add(GTK_CONTAINER(menuitem), box);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(label);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(image);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(box);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Set our data and callbacks. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set_data(G_OBJECT(menuitem), "purple_account", account);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set_data_full(G_OBJECT(menuitem), "purple_buddy_name", g_strdup(name), g_free);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(menuitem), "activate",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(menu_conv_sel_send_cb), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(menuitem);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 generate_send_to_items(PidginWindow *win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *menu;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GSList *group = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GSList *l, *buds;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(win != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = pidgin_conv_window_get_active_gtkconv(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(gtkconv != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (win->menu.send_to != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_destroy(win->menu.send_to);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Build the Send To menu */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->menu.send_to = gtk_menu_item_new_with_mnemonic(_("S_end To"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(win->menu.send_to);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu = gtk_menu_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_menu_shell_insert(GTK_MENU_SHELL(win->menu.menubar),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->menu.send_to, 2);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_menu_item_set_submenu(GTK_MENU_ITEM(win->menu.send_to), menu);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(menu);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->active_conv->type == PURPLE_CONV_TYPE_IM) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buds = purple_find_buddies(gtkconv->active_conv->account, gtkconv->active_conv->name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (buds == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* The user isn't on the buddy list. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 create_sendto_item(menu, sg, &group, NULL, gtkconv->active_conv->account, gtkconv->active_conv->name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *list = NULL, *iter;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (l = buds; l != NULL; l = l->next)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBlistNode *node;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 node = (PurpleBlistNode *) purple_buddy_get_contact((PurpleBuddy *)l->data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (node = node->child; node != NULL; node = node->next)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBuddy *buddy = (PurpleBuddy *)node;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleAccount *account;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!PURPLE_BLIST_NODE_IS_BUDDY(node))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 continue;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 account = purple_buddy_get_account(buddy);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_account_is_connected(account))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Use the PurplePresence to get unique buddies. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurplePresence *presence = purple_buddy_get_presence(buddy);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!g_list_find(list, presence))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 list = g_list_prepend(list, presence);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Loop over the list backwards so we get the items in the right order,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * since we did a g_list_prepend() earlier. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (iter = g_list_last(list); iter != NULL; iter = iter->prev)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurplePresence *pre = iter->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBuddy *buddy = purple_presence_get_buddy(pre);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 create_sendto_item(menu, sg, &group, buddy,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_buddy_get_account(buddy), purple_buddy_get_name(buddy));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_list_free(list);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_slist_free(buds);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_unref(sg);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(win->menu.send_to);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* TODO: This should never be insensitive. Possibly hidden or not. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!group)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(win->menu.send_to, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 update_send_to_selection(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GList *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 generate_invite_user_names(PurpleConnection *gc)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBlistNode *gnode,*cnode,*bnode;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GList *tmp = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_list_free(tmp);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tmp = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gc != NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for(gnode = purple_get_blist()->root; gnode; gnode = gnode->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(!PURPLE_BLIST_NODE_IS_GROUP(gnode))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 continue;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for(cnode = gnode->child; cnode; cnode = cnode->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(!PURPLE_BLIST_NODE_IS_CONTACT(cnode))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 continue;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for(bnode = cnode->child; bnode; bnode = bnode->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBuddy *buddy;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(!PURPLE_BLIST_NODE_IS_BUDDY(bnode))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 continue;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buddy = (PurpleBuddy *)bnode;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (buddy->account == gc->account &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_BUDDY_IS_ONLINE(buddy))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tmp = g_list_insert_sorted(tmp, buddy->name,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (GCompareFunc)g_utf8_collate);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return tmp;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GdkPixbuf *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 get_chat_buddy_status_icon(PurpleConvChat *chat, const char *name, PurpleConvChatBuddyFlags flags)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv = PIDGIN_CONVERSATION(chat->conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkPixbuf *pixbuf, *scale, *scale2;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *filename;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *image = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (flags & PURPLE_CBFLAGS_FOUNDER) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 image = PIDGIN_STOCK_STATUS_FOUNDER;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (flags & PURPLE_CBFLAGS_OP) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 image = PIDGIN_STOCK_STATUS_OPERATOR;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (flags & PURPLE_CBFLAGS_HALFOP) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 image = PIDGIN_STOCK_STATUS_HALFOP;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (flags & PURPLE_CBFLAGS_VOICE) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 image = PIDGIN_STOCK_STATUS_VOICE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if ((!flags) && purple_conv_chat_is_user_ignored(chat, name)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 image = PIDGIN_STOCK_STATUS_IGNORED;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pixbuf = gtk_widget_render_icon (gtkconv->tab_cont, image, gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "GtkTreeView");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!pixbuf)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 scale = gdk_pixbuf_scale_simple(pixbuf, 16, 16, GDK_INTERP_BILINEAR);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_unref(pixbuf);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (flags && purple_conv_chat_is_user_ignored(chat, name)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* TODO: the .../status/default directory isn't installed, should it be? */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 filename = g_build_filename(DATADIR, "pixmaps", "pidgin", "status", "default", "ignored.png", NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(filename);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 scale2 = gdk_pixbuf_scale_simple(pixbuf, 16, 16, GDK_INTERP_BILINEAR);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_unref(pixbuf);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gdk_pixbuf_composite(scale2, scale, 0, 0, 16, 16, 0, 0, 1, 1, GDK_INTERP_BILINEAR, 192);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_unref(scale2);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return scale;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 add_chat_buddy_common(PurpleConversation *conv, PurpleConvChatBuddy *cb, const char *old_name)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginChatPane *gtkchat;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConvChat *chat;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConnection *gc;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurplePluginProtocolInfo *prpl_info;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkListStore *ls;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkPixbuf *pixbuf;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTreeIter iter;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean is_me = FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean is_buddy;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gchar *tmp, *alias_key, *name, *alias;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int flags;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 alias = cb->alias;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 name = cb->name;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 flags = GPOINTER_TO_INT(cb->flags);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 chat = PURPLE_CONV_CHAT(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkchat = gtkconv->u.chat;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gc = purple_conversation_get_gc(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!gc || !(prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ls = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(gtkchat->list)));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pixbuf = get_chat_buddy_status_icon(chat, name, flags);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!strcmp(chat->nick, purple_normalize(conv->account, old_name != NULL ? old_name : name)))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 is_me = TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 is_buddy = cb->buddy;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tmp = g_utf8_casefold(alias, -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 alias_key = g_utf8_collate_key(tmp, -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(tmp);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (is_me)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkColor send_color;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gdk_color_parse(DEFAULT_SEND_COLOR, &send_color);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #if GTK_CHECK_VERSION(2,6,0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_list_store_insert_with_values(ls, &iter,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /*
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * The GTK docs are mute about the effects of the "row" value for performance.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * X-Chat hardcodes their value to 0 (prepend) and -1 (append), so we will too.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * It *might* be faster to search the gtk_list_store and set row accurately,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * but no one in #gtk+ seems to know anything about it either.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * Inserting in the "wrong" location has no visible ill effects. - F.P.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 -1, /* "row" */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_ICON_COLUMN, pixbuf,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_ALIAS_COLUMN, alias,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_ALIAS_KEY_COLUMN, alias_key,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_NAME_COLUMN, name,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_FLAGS_COLUMN, flags,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_COLOR_COLUMN, &send_color,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_WEIGHT_COLUMN, is_buddy ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_list_store_insert_with_values(ls, &iter,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 -1, /* "row" */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_ICON_COLUMN, pixbuf,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_ALIAS_COLUMN, alias,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_ALIAS_KEY_COLUMN, alias_key,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_NAME_COLUMN, name,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_FLAGS_COLUMN, flags,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_COLOR_COLUMN, get_nick_color(gtkconv, name),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_WEIGHT_COLUMN, is_buddy ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_list_store_append(ls, &iter);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_list_store_set(ls, &iter,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_ICON_COLUMN, pixbuf,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_ALIAS_COLUMN, alias,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_ALIAS_KEY_COLUMN, alias_key,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_NAME_COLUMN, name,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_FLAGS_COLUMN, flags,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_COLOR_COLUMN, &send_color,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_WEIGHT_COLUMN, is_buddy ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_list_store_append(ls, &iter);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_list_store_set(ls, &iter,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_ICON_COLUMN, pixbuf,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_ALIAS_COLUMN, alias,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_ALIAS_KEY_COLUMN, alias_key,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_NAME_COLUMN, name,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_FLAGS_COLUMN, flags,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_COLOR_COLUMN, get_nick_color(gtkconv, name),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_WEIGHT_COLUMN, is_buddy ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (pixbuf)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_unref(pixbuf);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(alias_key);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tab_complete_process_item(int *most_matched, char *entered, char **partial, char *nick_partial,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList **matches, gboolean command, char *name)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 strncpy(nick_partial, name, strlen(entered));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 nick_partial[strlen(entered)] = '\0';
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_utf8_strcasecmp(nick_partial, entered))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* if we're here, it's a possible completion */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (*most_matched == -1) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /*
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * this will only get called once, since from now
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * on *most_matched is >= 0
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 *most_matched = strlen(name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 *partial = g_strdup(name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (*most_matched) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *tmp = g_strdup(name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 while (purple_utf8_strcasecmp(tmp, *partial)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (*partial)[*most_matched] = '\0';
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (*most_matched < strlen(tmp))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tmp[*most_matched] = '\0';
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (*most_matched)--;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (*most_matched)++;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(tmp);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 *matches = g_list_insert_sorted(*matches, g_strdup(name),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (GCompareFunc)purple_utf8_strcasecmp);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tab_complete(PurpleConversation *conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTextIter cursor, word_start, start_buffer;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int start;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int most_matched = -1;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *entered, *partial = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *text;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *nick_partial;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *prefix;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *matches = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean command = FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_get_start_iter(gtkconv->entry_buffer, &start_buffer);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_get_iter_at_mark(gtkconv->entry_buffer, &cursor,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_get_insert(gtkconv->entry_buffer));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 word_start = cursor;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* if there's nothing there just return */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!gtk_text_iter_compare(&cursor, &start_buffer))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) ? TRUE : FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 text = gtk_text_buffer_get_text(gtkconv->entry_buffer, &start_buffer,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 &cursor, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* if we're at the end of ": " we need to move back 2 spaces */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 start = strlen(text) - 1;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (strlen(text) >= 2 && !strncmp(&text[start-1], ": ", 2)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_iter_backward_chars(&word_start, 2);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 start-=2;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* find the start of the word that we're tabbing */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 while (start >= 0 && text[start] != ' ') {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_iter_backward_char(&word_start);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 start--;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 prefix = pidgin_get_cmd_prefix();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (start == -1 && (strlen(text) >= strlen(prefix)) && !strncmp(text, prefix, strlen(prefix))) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 command = TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_iter_forward_chars(&word_start, strlen(prefix));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(text);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 entered = gtk_text_buffer_get_text(gtkconv->entry_buffer, &word_start,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 &cursor, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!g_utf8_strlen(entered, -1)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(entered);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) ? TRUE : FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 nick_partial = g_malloc(strlen(entered)+1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (command) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *list = purple_cmd_list(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *l;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Commands */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (l = list; l != NULL; l = l->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tab_complete_process_item(&most_matched, entered, &partial, nick_partial,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 &matches, TRUE, l->data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_list_free(list);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConvChat *chat = PURPLE_CONV_CHAT(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *l = purple_conv_chat_get_users(chat);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(PIDGIN_CONVERSATION(conv)->u.chat->list));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTreeIter iter;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int f;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Users */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (; l != NULL; l = l->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tab_complete_process_item(&most_matched, entered, &partial, nick_partial,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 &matches, TRUE, ((PurpleConvChatBuddy *)l->data)->name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Aliases */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 do {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *name;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *alias;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_tree_model_get(model, &iter,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_NAME_COLUMN, &name,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_ALIAS_COLUMN, &alias,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (name && alias && strcmp(name, alias))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tab_complete_process_item(&most_matched, entered, &partial, nick_partial,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 &matches, FALSE, alias);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(alias);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 f = gtk_tree_model_iter_next(model, &iter);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } while (f != 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(nick_partial);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(entered);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(nick_partial);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* we're only here if we're doing new style */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* if there weren't any matches, return */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!matches) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* if matches isn't set partials won't be either */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(entered);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) ? TRUE : FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_delete(gtkconv->entry_buffer, &word_start, &cursor);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!matches->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* there was only one match. fill it in. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_get_start_iter(gtkconv->entry_buffer, &start_buffer);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_get_iter_at_mark(gtkconv->entry_buffer, &cursor,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_get_insert(gtkconv->entry_buffer));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!gtk_text_iter_compare(&cursor, &start_buffer)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *tmp = g_strdup_printf("%s: ", (char *)matches->data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_insert_at_cursor(gtkconv->entry_buffer, tmp, -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(tmp);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_insert_at_cursor(gtkconv->entry_buffer,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 matches->data, -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(matches->data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 matches = g_list_remove(matches, matches->data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /*
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * there were lots of matches, fill in as much as possible
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * and display all of them
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *addthis = g_malloc0(1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 while (matches) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *tmp = addthis;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 addthis = g_strconcat(tmp, matches->data, " ", NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(tmp);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(matches->data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 matches = g_list_remove(matches, matches->data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_write(conv, NULL, addthis, PURPLE_MESSAGE_NO_LOG,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 time(NULL));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_insert_at_cursor(gtkconv->entry_buffer, partial, -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(addthis);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(entered);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(partial);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void topic_callback(GtkWidget *w, PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurplePluginProtocolInfo *prpl_info = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConnection *gc;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginChatPane *gtkchat;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *new_topic;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *current_topic;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gc = purple_conversation_get_gc(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(!gc || !(prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(prpl_info->set_chat_topic == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkchat = gtkconv->u.chat;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 new_topic = g_strdup(gtk_entry_get_text(GTK_ENTRY(gtkchat->topic_text)));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 current_topic = purple_conv_chat_get_topic(PURPLE_CONV_CHAT(conv));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(current_topic && !g_utf8_collate(new_topic, current_topic)){
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(new_topic);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_entry_set_text(GTK_ENTRY(gtkchat->topic_text), current_topic);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 prpl_info->set_chat_topic(gc, purple_conv_chat_get_id(PURPLE_CONV_CHAT(conv)),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 new_topic);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(new_topic);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gint
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 sort_chat_users(GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer userdata)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConvChatBuddyFlags f1 = 0, f2 = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *user1 = NULL, *user2 = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean buddy1 = FALSE, buddy2 = FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gint ret = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_tree_model_get(model, a,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_ALIAS_KEY_COLUMN, &user1,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_FLAGS_COLUMN, &f1,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_WEIGHT_COLUMN, &buddy1,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_tree_model_get(model, b,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_ALIAS_KEY_COLUMN, &user2,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_FLAGS_COLUMN, &f2,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_WEIGHT_COLUMN, &buddy2,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (user1 == NULL || user2 == NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!(user1 == NULL && user2 == NULL))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ret = (user1 == NULL) ? -1: 1;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (f1 != f2) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* sort more important users first */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ret = (f1 > f2) ? -1 : 1;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (buddy1 != buddy2) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ret = (buddy1 > buddy2) ? -1 : 1;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ret = strcmp(user1, user2);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(user1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(user2);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return ret;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 update_chat_alias(PurpleBuddy *buddy, PurpleConversation *conv, PurpleConnection *gc, PurplePluginProtocolInfo *prpl_info)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConvChat *chat = PURPLE_CONV_CHAT(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTreeModel *model;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *normalized_name;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTreeIter iter;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int f;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(buddy != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(conv != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* This is safe because this callback is only used in chats, not IMs. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 model = gtk_tree_view_get_model(GTK_TREE_VIEW(gtkconv->u.chat->list));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 normalized_name = g_strdup(purple_normalize(conv->account, buddy->name));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 do {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *name;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_tree_model_get(model, &iter, CHAT_USERS_NAME_COLUMN, &name, -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!strcmp(normalized_name, purple_normalize(conv->account, name))) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *alias = name;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *tmp;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *alias_key = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBuddy *buddy2;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (strcmp(chat->nick, purple_normalize(conv->account, name))) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* This user is not me, so look into updating the alias. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((buddy2 = purple_find_buddy(conv->account, name)) != NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 alias = purple_buddy_get_contact_alias(buddy2);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tmp = g_utf8_casefold(alias, -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 alias_key = g_utf8_collate_key(tmp, -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(tmp);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_list_store_set(GTK_LIST_STORE(model), &iter,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_ALIAS_COLUMN, alias,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_ALIAS_KEY_COLUMN, alias_key,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(alias_key);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 f = gtk_tree_model_iter_next(model, &iter);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } while (f != 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(normalized_name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 blist_node_aliased_cb(PurpleBlistNode *node, const char *old_alias, PurpleConversation *conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConnection *gc;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurplePluginProtocolInfo *prpl_info;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(node != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(conv != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gc = purple_conversation_get_gc(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(gc != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(gc->prpl != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (PURPLE_BLIST_NODE_IS_CONTACT(node))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBlistNode *bnode;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for(bnode = node->child; bnode; bnode = bnode->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(!PURPLE_BLIST_NODE_IS_BUDDY(bnode))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 continue;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 update_chat_alias((PurpleBuddy *)bnode, conv, gc, prpl_info);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (PURPLE_BLIST_NODE_IS_BUDDY(node))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 update_chat_alias((PurpleBuddy *)node, conv, gc, prpl_info);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (PURPLE_BLIST_NODE_IS_CHAT(node) &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_get_account(conv) == ((PurpleChat*)node)->account)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (old_alias == NULL || g_utf8_collate(old_alias, purple_conversation_get_title(conv)) == 0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_update_fields(conv, PIDGIN_CONV_SET_TITLE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buddy_cb_common(PurpleBuddy *buddy, PurpleConversation *conv, gboolean is_buddy)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTreeModel *model;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *normalized_name;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTreeIter iter;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int f;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(buddy != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(conv != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Do nothing if the buddy does not belong to the conv's account */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_buddy_get_account(buddy) != purple_conversation_get_account(conv))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* This is safe because this callback is only used in chats, not IMs. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 model = gtk_tree_view_get_model(GTK_TREE_VIEW(PIDGIN_CONVERSATION(conv)->u.chat->list));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 normalized_name = g_strdup(purple_normalize(conv->account, buddy->name));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 do {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *name;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_tree_model_get(model, &iter, CHAT_USERS_NAME_COLUMN, &name, -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!strcmp(normalized_name, purple_normalize(conv->account, name))) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_list_store_set(GTK_LIST_STORE(model), &iter,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_WEIGHT_COLUMN, is_buddy ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL, -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 f = gtk_tree_model_iter_next(model, &iter);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } while (f != 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(normalized_name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 blist_node_aliased_cb((PurpleBlistNode *)buddy, NULL, conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buddy_added_cb(PurpleBuddy *buddy, PurpleConversation *conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buddy_cb_common(buddy, conv, TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buddy_removed_cb(PurpleBuddy *buddy, PurpleConversation *conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* If there's another buddy for the same "dude" on the list, do nothing. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_find_buddy(buddy->account, buddy->name) != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buddy_cb_common(buddy, conv, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void send_menu_cb(GtkWidget *widget, PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_emit_by_name(gtkconv->entry, "message_send");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 entry_popup_menu_cb(GtkIMHtml *imhtml, GtkMenu *menu, gpointer data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *menuitem;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv = data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(menu != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(gtkconv != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menuitem = pidgin_new_item_from_stock(NULL, _("_Send"), NULL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(send_menu_cb), gtkconv,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 0, 0, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtk_text_buffer_get_char_count(imhtml->text_buffer) == 0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(menuitem, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_menu_shell_insert(GTK_MENU_SHELL(menu), menuitem, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menuitem = gtk_separator_menu_item_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(menuitem);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_menu_shell_insert(GTK_MENU_SHELL(menu), menuitem, 1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean resize_imhtml_cb(PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTextBuffer *buffer;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTextIter iter;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int wrapped_lines;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int lines;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkRectangle oneline;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkRequisition sr;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int height, diff;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int pad_top, pad_inside, pad_bottom;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->entry));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 wrapped_lines = 1;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_get_start_iter(buffer, &iter);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_view_get_iter_location(GTK_TEXT_VIEW(gtkconv->entry), &iter, &oneline);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 while (gtk_text_view_forward_display_line(GTK_TEXT_VIEW(gtkconv->entry), &iter))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 wrapped_lines++;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 lines = gtk_text_buffer_get_line_count(buffer);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Show a maximum of 4 lines */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 lines = MIN(lines, 4);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 wrapped_lines = MIN(MAX(wrapped_lines, 2), 4);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pad_top = gtk_text_view_get_pixels_above_lines(GTK_TEXT_VIEW(gtkconv->entry));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pad_bottom = gtk_text_view_get_pixels_below_lines(GTK_TEXT_VIEW(gtkconv->entry));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pad_inside = gtk_text_view_get_pixels_inside_wrap(GTK_TEXT_VIEW(gtkconv->entry));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 height = (oneline.height + pad_top + pad_bottom) * lines;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (wrapped_lines > lines)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 height += (oneline.height + pad_inside) * (wrapped_lines - lines);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->auto_resize = TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_idle_add(reset_auto_resize_cb, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 diff = height - gtkconv->entry->allocation.height;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_size_request(gtkconv->lower_hbox, &sr);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->entry_growing = TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_size_request(gtkconv->lower_hbox, -1,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 diff + gtkconv->lower_hbox->allocation.height);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 setup_chat_topic(PidginConversation *gtkconv, GtkWidget *vbox)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConnection *gc = purple_conversation_get_gc(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurplePluginProtocolInfo *prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (prpl_info->options & OPT_PROTO_CHAT_TOPIC)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *hbox, *label;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginChatPane *gtkchat = gtkconv->u.chat;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 label = gtk_label_new(_("Topic:"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkchat->topic_text = gtk_entry_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(prpl_info->set_chat_topic == NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_editable_set_editable(GTK_EDITABLE(gtkchat->topic_text), FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(GTK_OBJECT(gtkchat->topic_text), "activate",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(topic_callback), gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(hbox), gtkchat->topic_text, TRUE, TRUE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(gtkchat->topic_text), "key_press_event",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(entry_key_press_cb), gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_userlist_create_tooltip(GtkWidget *tipwindow, GtkTreePath *path,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gpointer userdata, int *w, int *h)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv = userdata;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTreeIter iter;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(gtkconv->u.chat->list));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBlistNode *node;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurplePluginProtocolInfo *prpl_info;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleAccount *account = purple_conversation_get_account(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *who = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (account->gc == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, path))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, CHAT_USERS_NAME_COLUMN, &who, -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(account->gc->prpl);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 node = (PurpleBlistNode*)(purple_find_buddy(conv->account, who));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (node && prpl_info && (prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_blist_draw_tooltip(node, gtkconv->infopane);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(who);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 setup_chat_userlist(PidginConversation *gtkconv, GtkWidget *hpaned)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginChatPane *gtkchat = gtkconv->u.chat;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *lbox, *sw, *list;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkListStore *ls;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkCellRenderer *rend;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTreeViewColumn *col;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int ul_width;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 void *blist_handle = purple_blist_get_handle();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Build the right pane. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 lbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_paned_pack2(GTK_PANED(hpaned), lbox, FALSE, TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(lbox);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Setup the label telling how many people are in the room. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkchat->count = gtk_label_new(_("0 people in room"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(lbox), gtkchat->count, FALSE, FALSE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(gtkchat->count);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Setup the list of users. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 sw = gtk_scrolled_window_new(NULL, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(lbox), sw, TRUE, TRUE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(sw);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ls = gtk_list_store_new(CHAT_USERS_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GDK_TYPE_COLOR, G_TYPE_INT);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(ls), CHAT_USERS_ALIAS_KEY_COLUMN,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 sort_chat_users, NULL, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 list = gtk_tree_view_new_with_model(GTK_TREE_MODEL(ls));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 rend = gtk_cell_renderer_pixbuf_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 col = gtk_tree_view_column_new_with_attributes(NULL, rend,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "pixbuf", CHAT_USERS_ICON_COLUMN, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_tree_view_column_set_sizing(col, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_tree_view_append_column(GTK_TREE_VIEW(list), col);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ul_width = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/chat/userlist_width");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_size_request(lbox, ul_width, -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Hack to prevent completely collapsed userlist coming back with a 1 pixel width.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * I would have liked to use the GtkPaned "max-position", but for some reason that didn't work */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (ul_width == 0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_paned_set_position(GTK_PANED(hpaned), 999999);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(list), "button_press_event",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(right_click_chat_cb), gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(list), "popup-menu",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(gtkconv_chat_popup_menu_cb), gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(lbox), "size-allocate", G_CALLBACK(lbox_size_allocate_cb), gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_tooltip_setup_for_treeview(list, gtkconv,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_userlist_create_tooltip, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 rend = gtk_cell_renderer_text_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set(rend,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "foreground-set", TRUE,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "weight-set", TRUE,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set(G_OBJECT(rend), "editable", TRUE, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 col = gtk_tree_view_column_new_with_attributes(NULL, rend,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "text", CHAT_USERS_ALIAS_COLUMN,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "foreground-gdk", CHAT_USERS_COLOR_COLUMN,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "weight", CHAT_USERS_WEIGHT_COLUMN,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_connect(blist_handle, "buddy-added",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkchat, PURPLE_CALLBACK(buddy_added_cb), conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_connect(blist_handle, "buddy-removed",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkchat, PURPLE_CALLBACK(buddy_removed_cb), conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_connect(blist_handle, "blist-node-aliased",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkchat, PURPLE_CALLBACK(blist_node_aliased_cb), conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #if GTK_CHECK_VERSION(2,6,0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_tree_view_column_set_expand(col, TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set(rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_tree_view_append_column(GTK_TREE_VIEW(list), col);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(list), FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(list);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkchat->list = list;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_container_add(GTK_CONTAINER(sw), list);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_create_tooltip(GtkWidget *tipwindow, gpointer userdata, int *w, int *h)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBlistNode *node = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv = userdata;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 node = (PurpleBlistNode*)(purple_blist_find_chat(conv->account, conv->name));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #if 0
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Using the transient blist nodes to show the tooltip doesn't quite work yet. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!node)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 node = g_object_get_data(G_OBJECT(gtkconv->imhtml), "transient_chat");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 node = (PurpleBlistNode*)(purple_find_buddy(conv->account, conv->name));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #if 0
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!node)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 node = g_object_get_data(G_OBJECT(gtkconv->imhtml), "transient_buddy");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (node)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_blist_draw_tooltip(node, gtkconv->infopane);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GtkWidget *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 setup_common_pane(PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *vbox, *frame, *imhtml_sw, *event_box;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkCellRenderer *rend;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTreePath *path;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean chat = (conv->type == PURPLE_CONV_TYPE_CHAT);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkPolicyType imhtml_sw_hscroll;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Setup the top part of the pane */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(vbox);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Setup the info pane */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 event_box = gtk_event_box_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #if GTK_CHECK_VERSION(2,4,0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_event_box_set_visible_window(GTK_EVENT_BOX(event_box), FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(event_box);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->infopane_hbox = gtk_hbox_new(FALSE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(vbox), event_box, FALSE, FALSE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_container_add(GTK_CONTAINER(event_box), gtkconv->infopane_hbox);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(gtkconv->infopane_hbox);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_add_events(event_box,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GDK_POINTER_MOTION_MASK | GDK_LEAVE_NOTIFY_MASK);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(event_box), "button-press-event",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(infopane_press_cb), gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_tooltip_setup_for_widget(event_box, gtkconv,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_create_tooltip, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->infopane = gtk_cell_view_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->infopane_model = gtk_list_store_new(CONV_NUM_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING, GDK_TYPE_PIXBUF, GDK_TYPE_PIXBUF);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_cell_view_set_model(GTK_CELL_VIEW(gtkconv->infopane),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_TREE_MODEL(gtkconv->infopane_model));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_list_store_append(gtkconv->infopane_model, &(gtkconv->infopane_iter));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(gtkconv->infopane_hbox), gtkconv->infopane, TRUE, TRUE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 path = gtk_tree_path_new_from_string("0");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_cell_view_set_displayed_row(GTK_CELL_VIEW(gtkconv->infopane), path);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_tree_path_free(path);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_size_request(gtkconv->infopane_hbox, -1, 32);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(gtkconv->infopane);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 rend = gtk_cell_renderer_pixbuf_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(gtkconv->infopane), rend, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(gtkconv->infopane), rend, "pixbuf", CONV_ICON_COLUMN, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set(rend, "xalign", 0.0, "xpad", 6, "ypad", 0, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 rend = gtk_cell_renderer_text_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(gtkconv->infopane), rend, TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(gtkconv->infopane), rend, "markup", CONV_TEXT_COLUMN, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set(rend, "ypad", 0, "yalign", 0.5, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #if GTK_CHECK_VERSION(2, 6, 0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set(rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 rend = gtk_cell_renderer_pixbuf_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(gtkconv->infopane), rend, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(gtkconv->infopane), rend, "pixbuf", CONV_PROTOCOL_ICON_COLUMN, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set(rend, "xalign", 0.0, "xpad", 3, "ypad", 0, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 rend = gtk_cell_renderer_pixbuf_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(gtkconv->infopane), rend, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(gtkconv->infopane), rend, "pixbuf", CONV_EMBLEM_COLUMN, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set(rend, "xalign", 0.0, "xpad", 6, "ypad", 0, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Setup the gtkimhtml widget */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 frame = pidgin_create_imhtml(FALSE, >kconv->imhtml, NULL, &imhtml_sw);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (chat) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *hpaned;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Add the topic */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 setup_chat_topic(gtkconv, vbox);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Add the gtkimhtml frame */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 hpaned = gtk_hpaned_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(vbox), hpaned, TRUE, TRUE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(hpaned);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_paned_pack1(GTK_PANED(hpaned), frame, TRUE, TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Now add the userlist */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 setup_chat_userlist(gtkconv, hpaned);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(frame);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_name(gtkconv->imhtml, "pidgin_conv_imhtml");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_show_comments(GTK_IMHTML(gtkconv->imhtml),TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_scrolled_window_get_policy(GTK_SCROLLED_WINDOW(imhtml_sw),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 &imhtml_sw_hscroll, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(imhtml_sw),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 imhtml_sw_hscroll, GTK_POLICY_ALWAYS);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect_after(G_OBJECT(gtkconv->imhtml), "button_press_event",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(entry_stop_rclick_cb), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(gtkconv->imhtml), "key_press_event",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(refocus_entry_cb), gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(gtkconv->imhtml), "key_release_event",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(refocus_entry_cb), gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->lower_hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(vbox), gtkconv->lower_hbox, FALSE, FALSE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(gtkconv->lower_hbox);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Setup the toolbar, entry widget and all signals */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 frame = pidgin_create_imhtml(TRUE, >kconv->entry, >kconv->toolbar, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(gtkconv->lower_hbox), frame, TRUE, TRUE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(frame);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_name(gtkconv->entry, "pidgin_conv_entry");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_set_protocol_name(GTK_IMHTML(gtkconv->entry),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_account_get_protocol_name(conv->account));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(gtkconv->entry), "populate-popup",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(entry_popup_menu_cb), gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(gtkconv->entry), "key_press_event",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(entry_key_press_cb), gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect_after(G_OBJECT(gtkconv->entry), "message_send",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(send_cb), gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect_after(G_OBJECT(gtkconv->entry), "button_press_event",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(entry_stop_rclick_cb), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->entry_buffer =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->entry));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set_data(G_OBJECT(gtkconv->entry_buffer), "user_data", gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!chat) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* For sending typing notifications for IMs */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 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);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->u.im->typing_timer = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->u.im->animate = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/im/animate_buddy_icons");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->u.im->show_icon = TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect_swapped(G_OBJECT(gtkconv->entry_buffer), "changed",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(resize_imhtml_cb), gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 default_formatize(gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect_after(G_OBJECT(gtkconv->entry), "format_function_clear",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(clear_formatting_cb), gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return vbox;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_dnd_recv(GtkWidget *widget, GdkDragContext *dc, guint x, guint y,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkSelectionData *sd, guint info, guint t,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win = gtkconv->win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *c;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (sd->target == gdk_atom_intern("PURPLE_BLIST_NODE", FALSE))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBlistNode *n = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBuddy *b;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 n = *(PurpleBlistNode **)sd->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (PURPLE_BLIST_NODE_IS_CONTACT(n))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 b = purple_contact_get_priority_buddy((PurpleContact*)n);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (PURPLE_BLIST_NODE_IS_BUDDY(n))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 b = (PurpleBuddy*)n;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /*
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * If we already have an open conversation with this buddy, then
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * just move the conv to this window. Otherwise, create a new
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * conv and add it to this window.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 c = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, b->name, b->account);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (c != NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *oldwin;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(c);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 oldwin = gtkconv->win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (oldwin != win) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_remove_gtkconv(oldwin, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_add_gtkconv(win, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 c = purple_conversation_new(PURPLE_CONV_TYPE_IM, b->account, b->name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(c);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->win != win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_remove_gtkconv(gtkconv->win, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_add_gtkconv(win, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Make this conversation the active conversation */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_switch_gtkconv(win, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_drag_finish(dc, TRUE, (dc->action == GDK_ACTION_MOVE), t);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (sd->target == gdk_atom_intern("application/x-im-contact", FALSE))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *protocol = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *username = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleAccount *account;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (pidgin_parse_x_im_contact((const char *)sd->data, FALSE, &account,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 &protocol, &username, NULL))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (account == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_notify_error(win, NULL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 _("You are not currently signed on with an account that "
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "can add that buddy."), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 c = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, username);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(c);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->win != win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_remove_gtkconv(gtkconv->win, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_add_gtkconv(win, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(username);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(protocol);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_drag_finish(dc, TRUE, (dc->action == GDK_ACTION_MOVE), t);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (sd->target == gdk_atom_intern("text/uri-list", FALSE)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_dnd_file_manage(sd, purple_conversation_get_account(conv), purple_conversation_get_name(conv));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_drag_finish(dc, TRUE, (dc->action == GDK_ACTION_MOVE), t);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_drag_finish(dc, FALSE, FALSE, t);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static const GtkTargetEntry te[] =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_IMHTML_DND_TARGETS,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {"PURPLE_BLIST_NODE", GTK_TARGET_SAME_APP, GTK_IMHTML_DRAG_NUM},
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {"application/x-im-contact", 0, GTK_IMHTML_DRAG_NUM + 1}
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 };
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static PidginConversation *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_find_gtkconv(PurpleConversation * conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBuddy *bud = purple_find_buddy(conv->account, conv->name), *b;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleContact *c;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBlistNode *cn;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!bud)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!(c = purple_buddy_get_contact(bud)))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 cn = (PurpleBlistNode *)c;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (b = (PurpleBuddy *)cn->child; b; b = (PurpleBuddy *) ((PurpleBlistNode *)b)->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, b->name, b->account))) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (conv->ui_data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return conv->ui_data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buddy_update_cb(PurpleBlistNode *bnode, gpointer null)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *list;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(bnode);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(bnode));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 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 (purple_conversation_get_type(conv) != PURPLE_CONV_TYPE_IM)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 continue;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_update_fields(conv, PIDGIN_CONV_MENU);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ignore_middle_click(GtkWidget *widget, GdkEventButton *e, gpointer null)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* A click on the pane is propagated to the notebook containing the pane.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * So if Stu accidentally aims high and middle clicks on the pane-handle,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * it causes a conversation tab to close. Let's stop that from happening.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (e->button == 2 && e->type == GDK_BUTTON_PRESS)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /**************************************************************************
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * Conversation UI operations
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 **************************************************************************/
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 private_gtkconv_new(PurpleConversation *conv, gboolean hidden)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversationType conv_type = purple_conversation_get_type(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *pane = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *tab_cont;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBlistNode *convnode;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleValue *value;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (conv_type == PURPLE_CONV_TYPE_IM && (gtkconv = pidgin_conv_find_gtkconv(conv))) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv->ui_data = gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!g_list_find(gtkconv->convs, conv))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->convs = g_list_prepend(gtkconv->convs, conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_switch_active_conversation(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = g_new0(PidginConversation, 1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv->ui_data = gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->active_conv = conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->convs = g_list_prepend(gtkconv->convs, conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->send_history = g_list_append(NULL, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Setup some initial variables. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->tooltips = gtk_tooltips_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->unseen_state = PIDGIN_UNSEEN_NONE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->unseen_count = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (conv_type == PURPLE_CONV_TYPE_IM) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->u.im = g_malloc0(sizeof(PidginImPane));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (conv_type == PURPLE_CONV_TYPE_CHAT) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->u.chat = g_malloc0(sizeof(PidginChatPane));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pane = setup_common_pane(gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_set_format_functions(GTK_IMHTML(gtkconv->imhtml),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_get_format_functions(GTK_IMHTML(gtkconv->imhtml)) | GTK_IMHTML_IMAGE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (pane == NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (conv_type == PURPLE_CONV_TYPE_CHAT)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(gtkconv->u.chat);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (conv_type == PURPLE_CONV_TYPE_IM)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(gtkconv->u.im);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv->ui_data = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Setup drag-and-drop */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_drag_dest_set(pane,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_DEST_DEFAULT_MOTION |
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_DEST_DEFAULT_DROP,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 te, sizeof(te) / sizeof(GtkTargetEntry),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GDK_ACTION_COPY);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_drag_dest_set(pane,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_DEST_DEFAULT_MOTION |
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_DEST_DEFAULT_DROP,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 te, sizeof(te) / sizeof(GtkTargetEntry),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GDK_ACTION_COPY);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_drag_dest_set(gtkconv->imhtml, 0,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 te, sizeof(te) / sizeof(GtkTargetEntry),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GDK_ACTION_COPY);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_drag_dest_set(gtkconv->entry, 0,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 te, sizeof(te) / sizeof(GtkTargetEntry),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GDK_ACTION_COPY);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(pane), "button_press_event",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(ignore_middle_click), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(pane), "drag_data_received",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(conv_dnd_recv), gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(gtkconv->imhtml), "drag_data_received",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(conv_dnd_recv), gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(gtkconv->entry), "drag_data_received",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(conv_dnd_recv), gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_create_tag(GTK_IMHTML(gtkconv->imhtml)->text_buffer, "TYPING-NOTIFICATION",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "foreground", "#888888",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "justification", GTK_JUSTIFY_LEFT, /* XXX: RTL'ify */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "weight", PANGO_WEIGHT_BOLD,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "scale", PANGO_SCALE_SMALL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Setup the container for the tab. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->tab_cont = tab_cont = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set_data(G_OBJECT(tab_cont), "PidginConversation", gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_container_set_border_width(GTK_CONTAINER(tab_cont), PIDGIN_HIG_BOX_SPACE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_container_add(GTK_CONTAINER(tab_cont), pane);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(pane);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 convnode = get_conversation_blist_node(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (convnode == NULL || !purple_blist_node_get_bool(convnode, "gtk-mute-sound"))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->make_sound = TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (convnode != NULL &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (value = g_hash_table_lookup(convnode->settings, "enable-logging")) &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_get_type(value) == PURPLE_TYPE_BOOLEAN)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_set_logging(conv, purple_value_get_boolean(value));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/show_formatting_toolbar"))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(gtkconv->toolbar);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_hide(gtkconv->toolbar);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_idle_add((GSourceFunc)resize_imhtml_cb, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/im/show_buddy_icons"))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(gtkconv->infopane_hbox);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_hide(gtkconv->infopane_hbox);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_show_comments(GTK_IMHTML(gtkconv->imhtml),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/show_timestamps"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_set_protocol_name(GTK_IMHTML(gtkconv->imhtml),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_account_get_protocol_name(conv->account));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect_swapped(G_OBJECT(pane), "focus",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(gtk_widget_grab_focus),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->entry);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (hidden)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_add_gtkconv(hidden_convwin, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_placement_place(gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (nick_colors == NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 nbr_nick_colors = NUM_NICK_COLORS;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 nick_colors = generate_nick_colors(&nbr_nick_colors, gtk_widget_get_style(gtkconv->imhtml)->base[GTK_STATE_NORMAL]);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_new_hidden(PurpleConversation *conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 private_gtkconv_new(conv, TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_new(PurpleConversation *conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 private_gtkconv_new(conv, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (PIDGIN_IS_PIDGIN_CONVERSATION(conv))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_emit(pidgin_conversations_get_handle(),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "conversation-displayed", PIDGIN_CONVERSATION(conv));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 received_im_msg_cb(PurpleAccount *account, char *sender, char *message,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv, PurpleMessageFlags flags)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversationUiOps *ui_ops = pidgin_conversations_get_conv_ui_ops();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean hide = FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* create hidden conv if hide_new pref is always */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new"), "always") == 0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 hide = TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* create hidden conv if hide_new pref is away and account is away */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new"), "away") == 0 &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 !purple_status_is_available(purple_account_get_active_status(account)))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 hide = TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (conv && PIDGIN_IS_PIDGIN_CONVERSATION(conv) && !hide) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->win == hidden_convwin) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_remove_gtkconv(gtkconv->win, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_placement_place(gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (hide) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ui_ops->create_conversation = pidgin_conv_new_hidden;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_new(PURPLE_CONV_TYPE_IM, account, sender);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ui_ops->create_conversation = pidgin_conv_new;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_destroy(PurpleConversation *conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->convs = g_list_remove(gtkconv->convs, conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Don't destroy ourselves until all our convos are gone */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->convs) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Make sure the destroyed conversation is not the active one */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->active_conv == conv) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->active_conv = gtkconv->convs->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_update(gtkconv->active_conv, PURPLE_CONV_UPDATE_FEATURES);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_remove_gtkconv(gtkconv->win, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* If the "Save Conversation" or "Save Icon" dialogs are open then close them */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_request_close_with_handle(gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_notify_close_with_handle(gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_destroy(gtkconv->tab_cont);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_unref(gtkconv->tab_cont);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->u.im->icon_timer != 0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_source_remove(gtkconv->u.im->icon_timer);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->u.im->anim != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_unref(G_OBJECT(gtkconv->u.im->anim));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->u.im->typing_timer != 0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_source_remove(gtkconv->u.im->typing_timer);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(gtkconv->u.im);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signals_disconnect_by_handle(gtkconv->u.chat);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(gtkconv->u.chat);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_object_sink(GTK_OBJECT(gtkconv->tooltips));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->send_history = g_list_first(gtkconv->send_history);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_list_foreach(gtkconv->send_history, (GFunc)g_free, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_list_free(gtkconv->send_history);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->attach.timer) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_source_remove(gtkconv->attach.timer);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_write_im(PurpleConversation *conv, const char *who,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *message, PurpleMessageFlags flags,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 time_t mtime)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (conv != gtkconv->active_conv &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 flags & PURPLE_MESSAGE_ACTIVE_ONLY)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Plugins that want these messages suppressed should be
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * calling purple_conv_im_write(), so they get suppressed here,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * before being written to the log. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_debug_info("gtkconv",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "Suppressing message for an inactive conversation in pidgin_conv_write_im()\n");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_write(conv, who, message, flags, mtime);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* The callback for an event on a link tag. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean buddytag_event(GtkTextTag *tag, GObject *imhtml,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkEvent *event, GtkTextIter *arg2, gpointer data) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (event->type == GDK_BUTTON_PRESS
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 || event->type == GDK_2BUTTON_PRESS) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkEventButton *btn_event = (GdkEventButton*) event;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *buddyname;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* strlen("BUDDY ") == 6 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_val_if_fail((tag->name != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 && (strlen(tag->name) > 6), FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buddyname = (tag->name) + 6;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (btn_event->button == 2
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 && event->type == GDK_2BUTTON_PRESS) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 chat_do_info(PIDGIN_CONVERSATION(conv), buddyname);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (btn_event->button == 3
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 && event->type == GDK_BUTTON_PRESS) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTextIter start, end;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* we shouldn't display the popup
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * if the user has selected something: */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!gtk_text_buffer_get_selection_bounds(
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_iter_get_buffer(arg2),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 &start, &end)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *menu = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConnection *gc =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_get_gc(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu = create_chat_menu(conv, buddyname, gc);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_menu_popup(GTK_MENU(menu), NULL, NULL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 NULL, GTK_WIDGET(imhtml),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 btn_event->button,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 btn_event->time);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Don't propagate the event any further */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GtkTextTag *get_buddy_tag(PurpleConversation *conv, const char *who) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTextTag *buddytag;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gchar *str;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 str = g_strdup_printf("BUDDY %s", who);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buddytag = gtk_text_tag_table_lookup(
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_get_tag_table(
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_IMHTML(gtkconv->imhtml)->text_buffer), str);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (buddytag == NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buddytag = gtk_text_buffer_create_tag(
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_IMHTML(gtkconv->imhtml)->text_buffer, str, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(buddytag), "event",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(buddytag_event), conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(str);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return buddytag;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void pidgin_conv_calculate_newday(PidginConversation *gtkconv, time_t mtime)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 struct tm *tm = localtime(&mtime);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tm->tm_hour = tm->tm_min = tm->tm_sec = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tm->tm_mday++;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->newday = mktime(tm);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Detect string direction and encapsulate the string in RLE/LRE/PDF unicode characters
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 str - pointer to string (string is re-allocated and the pointer updated) */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 str_embed_direction_chars(char **str)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #ifdef HAVE_PANGO14
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char pre_str[4];
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char post_str[10];
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *ret;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (PANGO_DIRECTION_RTL == pango_find_base_dir(*str, -1))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 sprintf(pre_str, "%c%c%c",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 0xE2, 0x80, 0xAB); /* RLE */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 sprintf(post_str, "%c%c%c%c%c%c%c%c%c",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 0xE2, 0x80, 0xAC, /* PDF */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 0xE2, 0x80, 0x8E, /* LRM */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 0xE2, 0x80, 0xAC); /* PDF */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 sprintf(pre_str, "%c%c%c",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 0xE2, 0x80, 0xAA); /* LRE */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 sprintf(post_str, "%c%c%c%c%c%c%c%c%c",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 0xE2, 0x80, 0xAC, /* PDF */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 0xE2, 0x80, 0x8F, /* RLM */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 0xE2, 0x80, 0xAC); /* PDF */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ret = g_strconcat(pre_str, *str, post_str, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(*str);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 *str = ret;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Returns true if the given HTML contains RTL text */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 html_is_rtl(const char *html)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GData *attributes;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const gchar *start, *end;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean res = FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_markup_find_tag("span", html, &start, &end, &attributes))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* tmp is a member of attributes and is free with g_datalist_clear call */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *tmp = g_datalist_get_data(&attributes, "dir");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (tmp && !g_ascii_strcasecmp(tmp, "RTL"))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 res = TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!res)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tmp = g_datalist_get_data(&attributes, "style");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (tmp)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *tmp2 = purple_markup_get_css_property(tmp, "direction");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (tmp2 && !g_ascii_strcasecmp(tmp2, "RTL"))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 res = TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(tmp2);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_datalist_clear(&attributes);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return res;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_write_conv(PurpleConversation *conv, const char *name, const char *alias,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *message, PurpleMessageFlags flags,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 time_t mtime)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConnection *gc;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleAccount *account;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurplePluginProtocolInfo *prpl_info;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int gtk_font_options = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int gtk_font_options_all = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int max_scrollback_lines;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int line_count;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char buf2[BUF_LONG];
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean show_date;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *mdate;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char color[10];
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *str;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *with_font_tag;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *sml_attrib = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 size_t length;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversationType type;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *displaying;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean plugin_return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *bracket;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int tag_count = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean is_rtl_message = FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkSmileyTree *tree = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GHashTable *smiley_data = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(conv != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(gtkconv != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->attach.timer) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* We are currently in the process of filling up the buffer with the message
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * history of the conversation. So we do not need to add the message here.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * Instead, this message will be added to the message-list, which in turn will
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * be processed and displayed by the attach-callback.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (conv != gtkconv->active_conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (flags & PURPLE_MESSAGE_ACTIVE_ONLY)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Unless this had PURPLE_MESSAGE_NO_LOG, this message
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * was logged. Plugin writers: if this isn't what
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * you wanted, call purple_conv_im_write() instead of
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * purple_conversation_write(). */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_debug_info("gtkconv",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "Suppressing message for an inactive conversation in pidgin_conv_write_conv()\n");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Set the active conversation to the one that just messaged us. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* TODO: consider not doing this if the account is offline or something */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (flags & (PURPLE_MESSAGE_SEND | PURPLE_MESSAGE_RECV))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_switch_active_conversation(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 type = purple_conversation_get_type(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 account = purple_conversation_get_account(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(account != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gc = purple_account_get_connection(account);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(gc != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Make sure URLs are clickable */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(flags & PURPLE_MESSAGE_NO_LINKIFY)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 displaying = g_strdup(message);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 displaying = purple_markup_linkify(message);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 plugin_return = GPOINTER_TO_INT(purple_signal_emit_return_1(
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conversations_get_handle(), (type == PURPLE_CONV_TYPE_IM ?
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "displaying-im-msg" : "displaying-chat-msg"),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 account, name, &displaying, conv, flags));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (plugin_return)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(displaying);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 length = strlen(displaying) + 1;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Awful hack to work around GtkIMHtml's inefficient rendering of messages with lots of formatting changes.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * If a message has over 100 '<' characters, strip formatting before appending it. Hopefully nobody actually
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * needs that much formatting, anyway.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (bracket = strchr(displaying, '<'); bracket && *(bracket + 1); bracket = strchr(bracket + 1, '<'))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tag_count++;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (tag_count > 100) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *tmp = displaying;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 displaying = purple_markup_strip_html(tmp);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(tmp);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win = gtkconv->win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 line_count = gtk_text_buffer_get_line_count(
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_view_get_buffer(GTK_TEXT_VIEW(
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->imhtml)));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 max_scrollback_lines = purple_prefs_get_int(
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PIDGIN_PREFS_ROOT "/conversations/scrollback_lines");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* If we're sitting at more than 100 lines more than the
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 max scrollback, trim down to max scrollback */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (max_scrollback_lines > 0
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 && line_count > (max_scrollback_lines + 100)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTextBuffer *text_buffer = gtk_text_view_get_buffer(
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_TEXT_VIEW(gtkconv->imhtml));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTextIter start, end;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_get_start_iter(text_buffer, &start);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_get_iter_at_line(text_buffer, &end,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (line_count - max_scrollback_lines));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_delete(GTK_IMHTML(gtkconv->imhtml), &start, &end);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (type == PURPLE_CONV_TYPE_CHAT)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Create anchor for user */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTextIter iter;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *tmp = g_strconcat("user:", name, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_get_end_iter(gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->imhtml)), &iter);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_create_mark(gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->imhtml)),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tmp, &iter, TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(tmp);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/use_smooth_scrolling"))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_font_options_all |= GTK_IMHTML_USE_SMOOTHSCROLLING;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtk_text_buffer_get_char_count(gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->imhtml))))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), "<BR>", gtk_font_options_all | GTK_IMHTML_NO_SCROLL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* First message in a conversation. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->newday == 0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_calculate_newday(gtkconv, mtime);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Show the date on the first message in a new day, or if the message is
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * older than 20 minutes. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 show_date = (mtime >= gtkconv->newday) || (time(NULL) > mtime + 20*60);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 mdate = purple_signal_emit_return_1(pidgin_conversations_get_handle(),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "conversation-timestamp",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv, mtime, show_date);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (mdate == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 struct tm *tm = localtime(&mtime);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *tmp;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (show_date)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tmp = purple_date_format_long(tm);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tmp = purple_time_format(tm);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 mdate = g_strdup_printf("(%s)", tmp);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Bi-Directional support - set timestamp direction using unicode characters */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 is_rtl_message = html_is_rtl(message);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Enforce direction only if message is RTL - doesn't effect LTR users */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (is_rtl_message)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 str_embed_direction_chars(&mdate);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (mtime >= gtkconv->newday)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_calculate_newday(gtkconv, mtime);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 sml_attrib = g_strdup_printf("sml=\"%s\"", purple_account_get_protocol_name(account));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_font_options |= GTK_IMHTML_NO_COMMENTS;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((flags & PURPLE_MESSAGE_RECV) &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 !purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting"))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_font_options |= GTK_IMHTML_NO_COLOURS | GTK_IMHTML_NO_FONTS | GTK_IMHTML_NO_SIZES | GTK_IMHTML_NO_FORMATTING;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* this is gonna crash one day, I can feel it. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (PURPLE_PLUGIN_PROTOCOL_INFO(purple_find_prpl(purple_account_get_protocol_id(conv->account)))->options &
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 OPT_PROTO_USE_POINTSIZE) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_font_options |= GTK_IMHTML_USE_POINTSIZE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!(flags & PURPLE_MESSAGE_RECV))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Temporarily revert to the original smiley-data to avoid showing up
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * custom smileys of the buddy when sending message
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tree = GTK_IMHTML(gtkconv->imhtml)->default_smilies;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_IMHTML(gtkconv->imhtml)->default_smilies =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_IMHTML(gtkconv->entry)->default_smilies;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 smiley_data = GTK_IMHTML(gtkconv->imhtml)->smiley_data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_IMHTML(gtkconv->imhtml)->smiley_data = GTK_IMHTML(gtkconv->entry)->smiley_data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* TODO: These colors should not be hardcoded so log.c can use them */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (flags & PURPLE_MESSAGE_RAW) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), message, gtk_font_options_all);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (flags & PURPLE_MESSAGE_SYSTEM) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_snprintf(buf2, sizeof(buf2),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "<FONT %s><FONT SIZE=\"2\"><!--%s --></FONT><B>%s</B></FONT>",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 sml_attrib ? sml_attrib : "", mdate, displaying);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), buf2, gtk_font_options_all);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (flags & PURPLE_MESSAGE_ERROR) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_snprintf(buf2, sizeof(buf2),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "<FONT COLOR=\"#ff0000\"><FONT %s><FONT SIZE=\"2\"><!--%s --></FONT><B>%s</B></FONT></FONT>",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 sml_attrib ? sml_attrib : "", mdate, displaying);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), buf2, gtk_font_options_all);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (flags & PURPLE_MESSAGE_NO_LOG) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_snprintf(buf2, BUF_LONG,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "<B><FONT %s COLOR=\"#777777\">%s</FONT></B>",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 sml_attrib ? sml_attrib : "", displaying);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), buf2, gtk_font_options_all);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *new_message = g_memdup(displaying, length);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *alias_escaped = (alias ? g_markup_escape_text(alias, strlen(alias)) : g_strdup(""));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* The initial offset is to deal with
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * escaped entities making the string longer */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int tag_start_offset = alias ? (strlen(alias_escaped) - strlen(alias)) : 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int tag_end_offset = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Enforce direction on alias */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (is_rtl_message)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 str_embed_direction_chars(&alias_escaped);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (flags & PURPLE_MESSAGE_WHISPER) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 str = g_malloc(1024);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* If we're whispering, it's not an autoresponse. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_message_meify(new_message, -1 )) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_snprintf(str, 1024, "***%s", alias_escaped);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 strcpy(color, "#6C2585");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tag_start_offset += 3;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_snprintf(str, 1024, "*%s*:", alias_escaped);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tag_start_offset += 1;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tag_end_offset = 2;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 strcpy(color, "#00FF00");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_message_meify(new_message, -1)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkColor *col;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 str = g_malloc(1024);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (flags & PURPLE_MESSAGE_AUTO_RESP) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_snprintf(str, 1024, "%s ***%s", AUTO_RESPONSE, alias_escaped);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tag_start_offset += 4
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 + strlen(AUTO_RESPONSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_snprintf(str, 1024, "***%s", alias_escaped);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tag_start_offset += 3;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (flags & PURPLE_MESSAGE_NICK)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_style_get(GTK_WIDGET(gtkconv->imhtml), "highlight-name-color", &col, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_style_get(GTK_WIDGET(gtkconv->imhtml), "action-name-color", &col, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(col) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_snprintf(color, sizeof(color), "#%02X%02X%02X",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 col->red >> 8, col->green >> 8, col->blue >> 8);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (flags & PURPLE_MESSAGE_NICK)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 strcpy(color, DEFAULT_HIGHLIGHT_COLOR);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 strcpy(color, DEFAULT_ACTION_COLOR);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 str = g_malloc(1024);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (flags & PURPLE_MESSAGE_AUTO_RESP) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_snprintf(str, 1024, "%s %s", alias_escaped, AUTO_RESPONSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tag_start_offset += 1
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 + strlen(AUTO_RESPONSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_snprintf(str, 1024, "%s:", alias_escaped);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tag_end_offset = 1;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (flags & PURPLE_MESSAGE_NICK) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkColor *col;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_style_get(GTK_WIDGET(gtkconv->imhtml), "highlight-name-color", &col, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(col) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_snprintf(color, sizeof(color), "#%02X%02X%02X",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 col->red >> 8, col->green >> 8, col->blue >> 8);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 strcpy(color, DEFAULT_HIGHLIGHT_COLOR);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (flags & PURPLE_MESSAGE_RECV) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (type == PURPLE_CONV_TYPE_CHAT) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkColor *col = get_nick_color(gtkconv, name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_snprintf(color, sizeof(color), "#%02X%02X%02X",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 col->red >> 8, col->green >> 8, col->blue >> 8);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkColor *col;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_style_get(GTK_WIDGET(gtkconv->imhtml), "receive-name-color", &col, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(col) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_snprintf(color, sizeof(color), "#%02X%02X%02X",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 col->red >> 8, col->green >> 8, col->blue >> 8);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 strcpy(color, DEFAULT_RECV_COLOR);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (flags & PURPLE_MESSAGE_SEND) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkColor *col;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_style_get(GTK_WIDGET(gtkconv->imhtml), "send-name-color", &col, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(col) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_snprintf(color, sizeof(color), "#%02X%02X%02X",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 col->red >> 8, col->green >> 8, col->blue >> 8);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 strcpy(color, DEFAULT_SEND_COLOR);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_debug_error("gtkconv", "message missing flags\n");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 strcpy(color, "#000000");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(alias_escaped);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Are we in a chat where we can tell which users are buddies? */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME) &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Bold buddies to make them stand out from non-buddies. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (flags & PURPLE_MESSAGE_SEND ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 flags & PURPLE_MESSAGE_NICK ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_find_buddy(account, name) != NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_snprintf(buf2, BUF_LONG,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "<FONT COLOR=\"%s\" %s><FONT SIZE=\"2\"><!--%s --></FONT>"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "<B>%s</B></FONT> ",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 color, sml_attrib ? sml_attrib : "", mdate, str);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_snprintf(buf2, BUF_LONG,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "<FONT COLOR=\"%s\" %s><FONT SIZE=\"2\"><!--%s --></FONT>"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "%s</FONT> ",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 color, sml_attrib ? sml_attrib : "", mdate, str);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Bold everyone's name to make the name stand out from the message. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_snprintf(buf2, BUF_LONG,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "<FONT COLOR=\"%s\" %s><FONT SIZE=\"2\"><!--%s --></FONT>"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "<B>%s</B></FONT> ",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 color, sml_attrib ? sml_attrib : "", mdate, str);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), buf2, gtk_font_options_all | GTK_IMHTML_NO_SCROLL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 !(flags & PURPLE_MESSAGE_SEND)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTextIter start, end;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTextTag *buddytag = get_buddy_tag(conv, name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_get_end_iter(
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_IMHTML(gtkconv->imhtml)->text_buffer,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 &end);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_iter_backward_chars(&end,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tag_end_offset + 1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_get_end_iter(
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_IMHTML(gtkconv->imhtml)->text_buffer,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 &start);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_iter_backward_chars(&start,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 strlen(str) + 1 - tag_start_offset);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_buffer_apply_tag(
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_IMHTML(gtkconv->imhtml)->text_buffer,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buddytag, &start, &end);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(str);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(gc){
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *pre = g_strdup_printf("<font %s>", sml_attrib ? sml_attrib : "");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *post = "</font>";
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int pre_len = strlen(pre);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int post_len = strlen(post);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 with_font_tag = g_malloc(length + pre_len + post_len + 1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 strcpy(with_font_tag, pre);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 memcpy(with_font_tag + pre_len, new_message, length);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 strcpy(with_font_tag + pre_len + length, post);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 length += pre_len + post_len;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(pre);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 with_font_tag = g_memdup(new_message, length);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 with_font_tag, gtk_font_options | gtk_font_options_all);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(with_font_tag);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(new_message);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(mdate);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(sml_attrib);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Tab highlighting stuff */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!(flags & PURPLE_MESSAGE_SEND) && !pidgin_conv_has_focus(conv))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginUnseenState unseen = PIDGIN_UNSEEN_NONE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((flags & PURPLE_MESSAGE_NICK) == PURPLE_MESSAGE_NICK)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 unseen = PIDGIN_UNSEEN_NICK;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (((flags & PURPLE_MESSAGE_SYSTEM) == PURPLE_MESSAGE_SYSTEM) ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ((flags & PURPLE_MESSAGE_ERROR) == PURPLE_MESSAGE_ERROR))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 unseen = PIDGIN_UNSEEN_EVENT;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if ((flags & PURPLE_MESSAGE_NO_LOG) == PURPLE_MESSAGE_NO_LOG)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 unseen = PIDGIN_UNSEEN_NO_LOG;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 unseen = PIDGIN_UNSEEN_TEXT;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv_set_unseen(gtkconv, unseen);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!(flags & PURPLE_MESSAGE_RECV))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Restore the smiley-data */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_IMHTML(gtkconv->imhtml)->default_smilies = tree;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_IMHTML(gtkconv->imhtml)->smiley_data = smiley_data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_emit(pidgin_conversations_get_handle(),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (type == PURPLE_CONV_TYPE_IM ? "displayed-im-msg" : "displayed-chat-msg"),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 account, name, displaying, conv, flags);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(displaying);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 update_typing_message(gtkconv, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_chat_add_users(PurpleConversation *conv, GList *cbuddies, gboolean new_arrivals)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConvChat *chat;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginChatPane *gtkchat;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkListStore *ls;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *l;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char tmp[BUF_LONG];
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int num_users;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 chat = PURPLE_CONV_CHAT(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkchat = gtkconv->u.chat;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 num_users = g_list_length(purple_conv_chat_get_users(chat));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_snprintf(tmp, sizeof(tmp),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ngettext("%d person in room", "%d people in room",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 num_users),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 num_users);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_label_set_text(GTK_LABEL(gtkchat->count), tmp);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ls = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(gtkchat->list)));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #if GTK_CHECK_VERSION(2,6,0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(ls), GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 l = cbuddies;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 while (l != NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 add_chat_buddy_common(conv, (PurpleConvChatBuddy *)l->data, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 l = l->next;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Currently GTK+ maintains our sorted list after it's in the tree.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * This may change if it turns out we can manage it faster ourselves.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(ls), CHAT_USERS_ALIAS_KEY_COLUMN,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_SORT_ASCENDING);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_chat_rename_user(PurpleConversation *conv, const char *old_name,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *new_name, const char *new_alias)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConvChat *chat;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginChatPane *gtkchat;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConvChatBuddyFlags flags;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConvChatBuddy *cbuddy;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTreeIter iter;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTreeModel *model;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int f = 1;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 chat = PURPLE_CONV_CHAT(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkchat = gtkconv->u.chat;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 model = gtk_tree_view_get_model(GTK_TREE_VIEW(gtkchat->list));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 while (f != 0) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *val;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, CHAT_USERS_NAME_COLUMN, &val, CHAT_USERS_FLAGS_COLUMN, &flags, -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!purple_utf8_strcasecmp(old_name, val)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(val);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 f = gtk_tree_model_iter_next(GTK_TREE_MODEL(model), &iter);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(val);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!purple_conv_chat_find_user(chat, old_name))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(new_alias != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 cbuddy = purple_conv_chat_cb_find(chat, new_name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 add_chat_buddy_common(conv, cbuddy, old_name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_chat_remove_users(PurpleConversation *conv, GList *users)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConvChat *chat;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginChatPane *gtkchat;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTreeIter iter;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTreeModel *model;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *l;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char tmp[BUF_LONG];
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int num_users;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean f;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 chat = PURPLE_CONV_CHAT(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkchat = gtkconv->u.chat;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 num_users = g_list_length(purple_conv_chat_get_users(chat));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (l = users; l != NULL; l = l->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 model = gtk_tree_view_get_model(GTK_TREE_VIEW(gtkchat->list));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 continue;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 do {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *val;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CHAT_USERS_NAME_COLUMN, &val, -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!purple_utf8_strcasecmp((char *)l->data, val)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #if GTK_CHECK_VERSION(2,2,0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 f = gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 f = gtk_tree_model_iter_next(GTK_TREE_MODEL(model), &iter);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 f = gtk_tree_model_iter_next(GTK_TREE_MODEL(model), &iter);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(val);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } while (f);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_snprintf(tmp, sizeof(tmp),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ngettext("%d person in room", "%d people in room",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 num_users), num_users);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_label_set_text(GTK_LABEL(gtkchat->count), tmp);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_chat_update_user(PurpleConversation *conv, const char *user)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConvChat *chat;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConvChatBuddyFlags flags;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConvChatBuddy *cbuddy;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginChatPane *gtkchat;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTreeIter iter;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTreeModel *model;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int f = 1;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *alias = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 chat = PURPLE_CONV_CHAT(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkchat = gtkconv->u.chat;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 model = gtk_tree_view_get_model(GTK_TREE_VIEW(gtkchat->list));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 while (f != 0) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *val;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, CHAT_USERS_NAME_COLUMN, &val, -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!purple_utf8_strcasecmp(user, val)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, CHAT_USERS_ALIAS_COLUMN, &alias, -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(val);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 f = gtk_tree_model_iter_next(GTK_TREE_MODEL(model), &iter);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(val);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!purple_conv_chat_find_user(chat, user))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(alias);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(alias != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 flags = purple_conv_chat_user_get_flags(chat, user);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 cbuddy = purple_conv_chat_cb_find(chat, user);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (cbuddy)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 add_chat_buddy_common(conv, cbuddy, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(alias);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_has_focus(PurpleConversation *conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean has_focus;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win = gtkconv->win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_get(G_OBJECT(win->window), "has-toplevel-focus", &has_focus, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (has_focus && pidgin_conv_window_is_active_conversation(conv))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void pidgin_conv_custom_smiley_allocated(GdkPixbufLoader *loader, gpointer user_data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkIMHtmlSmiley *smiley;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 smiley = (GtkIMHtmlSmiley *)user_data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 smiley->icon = gdk_pixbuf_loader_get_animation(loader);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (smiley->icon)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_ref(G_OBJECT(smiley->icon));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #ifdef DEBUG_CUSTOM_SMILEY
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_debug_info("custom-smiley", "pidgin_conv_custom_smiley_allocated(): got GdkPixbufAnimation %p for smiley '%s'\n", smiley->icon, smiley->smile);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void pidgin_conv_custom_smiley_closed(GdkPixbufLoader *loader, gpointer user_data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkIMHtmlSmiley *smiley;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *icon = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkTextChildAnchor *anchor = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GSList *current = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 smiley = (GtkIMHtmlSmiley *)user_data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!smiley->imhtml) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #ifdef DEBUG_CUSTOM_SMILEY
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_debug_error("custom-smiley", "pidgin_conv_custom_smiley_closed(): orphan smiley found: %p\n", smiley);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_unref(G_OBJECT(loader));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 smiley->loader = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (current = smiley->anchors; current; current = g_slist_next(current)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 icon = gtk_image_new_from_animation(smiley->icon);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #ifdef DEBUG_CUSTOM_SMILEY
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_debug_info("custom-smiley", "pidgin_conv_custom_smiley_closed(): got GtkImage %p from GtkPixbufAnimation %p for smiley '%s'\n",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 icon, smiley->icon, smiley->smile);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (icon) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *wids;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(icon);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 anchor = GTK_TEXT_CHILD_ANCHOR(current->data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 wids = gtk_text_child_anchor_get_widgets(anchor);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_plaintext", purple_unescape_html(smiley->smile), g_free);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_htmltext", g_strdup(smiley->smile), g_free);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (smiley->imhtml) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (wids) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *children = gtk_container_get_children(GTK_CONTAINER(wids->data));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_list_foreach(children, (GFunc)gtk_widget_destroy, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_list_free(children);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_container_add(GTK_CONTAINER(wids->data), icon);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_text_view_add_child_at_anchor(GTK_TEXT_VIEW(smiley->imhtml), icon, anchor);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_list_free(wids);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_slist_free(smiley->anchors);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 smiley->anchors = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_unref(G_OBJECT(loader));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 smiley->loader = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 add_custom_smiley_for_imhtml(GtkIMHtml *imhtml, const char *sml, const char *smile)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkIMHtmlSmiley *smiley;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkPixbufLoader *loader;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 smiley = gtk_imhtml_smiley_get(imhtml, sml, smile);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (smiley) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!(smiley->flags & GTK_IMHTML_SMILEY_CUSTOM)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Close the old GdkPixbufAnimation, then create a new one for
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * the smiley we are about to receive */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_unref(G_OBJECT(smiley->icon));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* XXX: Is it necessary to _unref the loader first? */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 smiley->loader = gdk_pixbuf_loader_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 smiley->icon = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(smiley->loader, "area_prepared", G_CALLBACK(pidgin_conv_custom_smiley_allocated), smiley);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(smiley->loader, "closed", G_CALLBACK(pidgin_conv_custom_smiley_closed), smiley);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 loader = gdk_pixbuf_loader_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* this is wrong, this file ought not call g_new on GtkIMHtmlSmiley */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Let gtk_imhtml have a gtk_imhtml_smiley_new function, and let
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkIMHtmlSmiley by opaque */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 smiley = g_new0(GtkIMHtmlSmiley, 1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 smiley->file = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 smiley->smile = g_strdup(smile);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 smiley->loader = loader;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 smiley->flags = smiley->flags | GTK_IMHTML_SMILEY_CUSTOM;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(smiley->loader, "area_prepared", G_CALLBACK(pidgin_conv_custom_smiley_allocated), smiley);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(smiley->loader, "closed", G_CALLBACK(pidgin_conv_custom_smiley_closed), smiley);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_associate_smiley(imhtml, sml, smiley);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_custom_smiley_add(PurpleConversation *conv, const char *smile, gboolean remote)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 struct smiley_list *list;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *sml = NULL, *conv_sml;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!conv || !smile || !*smile) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* If smileys are off, return false */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (pidgin_themes_smileys_disabled())
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* If possible add this smiley to the current theme.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * The addition is only temporary: custom smilies aren't saved to disk. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_sml = purple_account_get_protocol_name(conv->account);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (list = (struct smiley_list *)current_smiley_theme->list; list; list = list->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!strcmp(list->sml, conv_sml)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 sml = list->sml;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!add_custom_smiley_for_imhtml(GTK_IMHTML(gtkconv->imhtml), sml, smile))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!remote) /* If it's a local custom smiley, then add it for the entry */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!add_custom_smiley_for_imhtml(GTK_IMHTML(gtkconv->entry), sml, smile))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_custom_smiley_write(PurpleConversation *conv, const char *smile,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const guchar *data, gsize size)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkIMHtmlSmiley *smiley;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkPixbufLoader *loader;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *sml;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 sml = purple_account_get_protocol_name(conv->account);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 smiley = gtk_imhtml_smiley_get(GTK_IMHTML(gtkconv->imhtml), sml, smile);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!smiley)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 loader = smiley->loader;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!loader)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gdk_pixbuf_loader_write(loader, data, size, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_custom_smiley_close(PurpleConversation *conv, const char *smile)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkIMHtmlSmiley *smiley;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkPixbufLoader *loader;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *sml;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(conv != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(smile != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 sml = purple_account_get_protocol_name(conv->account);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 smiley = gtk_imhtml_smiley_get(GTK_IMHTML(gtkconv->imhtml), sml, smile);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!smiley)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 loader = smiley->loader;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!loader)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_debug_info("gtkconv", "About to close the smiley pixbuf\n");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gdk_pixbuf_loader_close(loader, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_send_confirm(PurpleConversation *conv, const char *message)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->entry), message, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /*
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * Makes sure all the menu items and all the buttons are hidden/shown and
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * sensitive/insensitive. This is called after changing tabs and when an
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * account signs on or off.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gray_stuff_out(PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConnection *gc;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurplePluginProtocolInfo *prpl_info = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkPixbuf *window_icon = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkIMHtmlButtons buttons;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleAccount *account;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win = pidgin_conv_get_window(gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gc = purple_conversation_get_gc(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 account = purple_conversation_get_account(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gc != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (win->menu.send_to != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 update_send_to_selection(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /*
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * Handle hiding and showing stuff based on what type of conv this is.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * Stuff that Purple IMs support in general should be shown for IM
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * conversations. Stuff that Purple chats support in general should be
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * shown for chat conversations. It doesn't matter whether the PRPL
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * supports it or not--that only affects if the button or menu item
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * is sensitive or not.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Show stuff that applies to IMs, hide stuff that applies to chats */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Deal with menu items */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(win->menu.view_log);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(win->menu.send_file);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(win->menu.add_pounce);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(win->menu.get_info);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_hide(win->menu.invite);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(win->menu.alias);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_privacy_check(account, purple_conversation_get_name(conv))) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_hide(win->menu.unblock);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(win->menu.block);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_hide(win->menu.block);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(win->menu.unblock);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((account == NULL) || purple_find_buddy(account, purple_conversation_get_name(conv)) == NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(win->menu.add);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_hide(win->menu.remove);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(win->menu.remove);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_hide(win->menu.add);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(win->menu.insert_link);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(win->menu.insert_image);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Show stuff that applies to Chats, hide stuff that applies to IMs */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Deal with menu items */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(win->menu.view_log);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_hide(win->menu.send_file);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_hide(win->menu.add_pounce);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_hide(win->menu.get_info);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(win->menu.invite);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(win->menu.alias);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_hide(win->menu.block);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_hide(win->menu.unblock);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((account == NULL) || purple_blist_find_chat(account, purple_conversation_get_name(conv)) == NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* If the chat is NOT in the buddy list */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(win->menu.add);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_hide(win->menu.remove);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* If the chat IS in the buddy list */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_hide(win->menu.add);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(win->menu.remove);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(win->menu.insert_link);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(win->menu.insert_image);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /*
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * Handle graying stuff out based on whether an account is connected
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * and what features that account supports.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((gc != NULL) &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ((purple_conversation_get_type(conv) != PURPLE_CONV_TYPE_CHAT) ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 !purple_conv_chat_has_left(PURPLE_CONV_CHAT(conv)) ))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Account is online */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Deal with the toolbar */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (conv->features & PURPLE_CONNECTION_HTML)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buttons = GTK_IMHTML_ALL; /* Everything on */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (conv->features & PURPLE_CONNECTION_NO_BGCOLOR)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buttons &= ~GTK_IMHTML_BACKCOLOR;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (conv->features & PURPLE_CONNECTION_NO_FONTSIZE)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buttons &= ~GTK_IMHTML_GROW;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buttons &= ~GTK_IMHTML_SHRINK;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (conv->features & PURPLE_CONNECTION_NO_URLDESC)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buttons &= ~GTK_IMHTML_LINKDESC;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buttons = GTK_IMHTML_SMILEY | GTK_IMHTML_IMAGE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!(prpl_info->options & OPT_PROTO_IM_IMAGE))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv->features |= PURPLE_CONNECTION_NO_IMAGES;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(conv->features & PURPLE_CONNECTION_NO_IMAGES)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buttons &= ~GTK_IMHTML_IMAGE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_set_format_functions(GTK_IMHTML(gtkconv->entry), buttons);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (account != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtmltoolbar_associate_smileys(GTK_IMHTMLTOOLBAR(gtkconv->toolbar), purple_account_get_protocol_id(account));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Deal with menu items */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(win->menu.view_log, TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(win->menu.add_pounce, TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(win->menu.get_info, (prpl_info->get_info != NULL));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(win->menu.invite, (prpl_info->chat_invite != NULL));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(win->menu.insert_link, (conv->features & PURPLE_CONNECTION_HTML));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(win->menu.insert_image, !(conv->features & PURPLE_CONNECTION_NO_IMAGES));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(win->menu.add, (prpl_info->add_buddy != NULL));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(win->menu.remove, (prpl_info->remove_buddy != NULL));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(win->menu.send_file,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (prpl_info->send_file != NULL && (!prpl_info->can_receive_file ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 prpl_info->can_receive_file(gc, purple_conversation_get_name(conv)))));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(win->menu.alias,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (account != NULL) &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (purple_find_buddy(account, purple_conversation_get_name(conv)) != NULL));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(win->menu.add, (prpl_info->join_chat != NULL));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(win->menu.remove, (prpl_info->join_chat != NULL));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(win->menu.alias,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (account != NULL) &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (purple_blist_find_chat(account, purple_conversation_get_name(conv)) != NULL));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Account is offline */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Or it's a chat that we've left. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Then deal with menu items */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(win->menu.view_log, TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(win->menu.send_file, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(win->menu.add_pounce, TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(win->menu.get_info, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(win->menu.invite, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(win->menu.alias, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(win->menu.add, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(win->menu.remove, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(win->menu.insert_link, TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_sensitive(win->menu.insert_image, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /*
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * Update the window's icon
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (pidgin_conv_window_is_active_conversation(conv))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *l = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (gtkconv->u.im->anim))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBuddy *buddy = purple_find_buddy(conv->account, conv->name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 window_icon =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gdk_pixbuf_animation_get_static_image(gtkconv->u.im->anim);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (buddy && !PURPLE_BUDDY_IS_ONLINE(buddy))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gdk_pixbuf_saturate_and_pixelate(window_icon, window_icon, 0.0, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_ref(window_icon);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 l = g_list_append(l, window_icon);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 l = pidgin_conv_get_tab_icons(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_window_set_icon_list(GTK_WINDOW(win->window), l);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (window_icon != NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_unref(G_OBJECT(window_icon));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_list_free(l);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_update_fields(PurpleConversation *conv, PidginConvFields fields)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win = pidgin_conv_get_window(gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (fields & PIDGIN_CONV_SET_TITLE)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_autoset_title(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (fields & PIDGIN_CONV_BUDDY_ICON)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_update_buddy_icon(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (fields & PIDGIN_CONV_MENU)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gray_stuff_out(PIDGIN_CONVERSATION(conv));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 generate_send_to_items(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (fields & PIDGIN_CONV_TAB_ICON)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 update_tab_icon(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 generate_send_to_items(win); /* To update the icons in SendTo menu */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((fields & PIDGIN_CONV_TOPIC) &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *topic;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConvChat *chat = PURPLE_CONV_CHAT(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginChatPane *gtkchat = gtkconv->u.chat;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkchat->topic_text != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 topic = purple_conv_chat_get_topic(chat);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_entry_set_text(GTK_ENTRY(gtkchat->topic_text), topic ? topic : "");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_tooltips_set_tip(gtkconv->tooltips, gtkchat->topic_text,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 topic ? topic : "", NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (fields & PIDGIN_CONV_SMILEY_THEME)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_themes_smiley_themeize(PIDGIN_CONVERSATION(conv)->imhtml);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((fields & PIDGIN_CONV_COLORIZE_TITLE) ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (fields & PIDGIN_CONV_SET_TITLE) ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (fields & PIDGIN_CONV_TOPIC))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *title;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConvIm *im = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleAccount *account = purple_conversation_get_account(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBuddy *buddy = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurplePresence *p = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *markup = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 AtkObject *accessibility_obj;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* I think this is a little longer than it needs to be but I'm lazy. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *style;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 im = PURPLE_CONV_IM(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((account == NULL) ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 !purple_account_is_connected(account) ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ((purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 && purple_conv_chat_has_left(PURPLE_CONV_CHAT(conv))))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 title = g_strdup_printf("(%s)", purple_conversation_get_title(conv));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 title = g_strdup(purple_conversation_get_title(conv));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buddy = purple_find_buddy(account, conv->name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (buddy) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 p = purple_buddy_get_presence(buddy);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 markup = pidgin_blist_get_name_markup(buddy, FALSE, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 markup = title;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *topic = gtkconv->u.chat->topic_text ? gtk_entry_get_text(GTK_ENTRY(gtkconv->u.chat->topic_text)) : NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *esc = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #if GTK_CHECK_VERSION(2,6,0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 esc = topic ? g_markup_escape_text(topic, -1) : NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* GTK < 2.6 doesn't have auto ellipsization, so we do a crude
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * trucation to prevent forcing the window to be as wide as the topic */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int len = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *c, *tmp = g_strdup(topic);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 c = tmp;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 while(*c && len < 72) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 c = g_utf8_next_char(c);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 len++;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (len == 72) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 *c = '\0';
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 c = g_strdup_printf("%s...", tmp);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(tmp);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tmp = c;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 esc = tmp ? g_markup_escape_text(tmp, -1) : NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(tmp);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 markup = g_strdup_printf("%s%s<span color='%s' size='smaller'>%s</span>",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_get_title(conv),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 esc && *esc ? "\n" : "",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_get_dim_grey_string(gtkconv->infopane),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 esc ? esc : "");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(esc);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_list_store_set(gtkconv->infopane_model, &(gtkconv->infopane_iter),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 CONV_TEXT_COLUMN, markup, -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* XXX seanegan Why do I have to do this? */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_queue_draw(gtkconv->infopane);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (title != markup)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(markup);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!GTK_WIDGET_REALIZED(gtkconv->tab_label))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_realize(gtkconv->tab_label);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 accessibility_obj = gtk_widget_get_accessible(gtkconv->tab_cont);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (im != NULL &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conv_im_get_typing_state(im) == PURPLE_TYPING) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 atk_object_set_description(accessibility_obj, _("Typing"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 style = "tab-label-typing";
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (im != NULL &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conv_im_get_typing_state(im) == PURPLE_TYPED) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 atk_object_set_description(accessibility_obj, _("Stopped Typing"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 style = "tab-label-typed";
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (gtkconv->unseen_state == PIDGIN_UNSEEN_NICK) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 atk_object_set_description(accessibility_obj, _("Nick Said"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 style = "tab-label-attention";
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (gtkconv->unseen_state == PIDGIN_UNSEEN_TEXT) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 atk_object_set_description(accessibility_obj, _("Unread Messages"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->active_conv->type == PURPLE_CONV_TYPE_CHAT)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 style = "tab-label-unreadchat";
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 style = "tab-label-attention";
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (gtkconv->unseen_state == PIDGIN_UNSEEN_EVENT) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 atk_object_set_description(accessibility_obj, _("New Event"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 style = "tab-label-event";
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 style = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_name(gtkconv->tab_label, style);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_label_set_text(GTK_LABEL(gtkconv->tab_label), title);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_state(gtkconv->tab_label, GTK_STATE_ACTIVE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->unseen_state == PIDGIN_UNSEEN_TEXT ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->unseen_state == PIDGIN_UNSEEN_NICK ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->unseen_state == PIDGIN_UNSEEN_EVENT) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PangoAttrList *list = pango_attr_list_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PangoAttribute *attr = pango_attr_weight_new(PANGO_WEIGHT_BOLD);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 attr->start_index = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 attr->end_index = -1;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pango_attr_list_insert(list, attr);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_label_set_attributes(GTK_LABEL(gtkconv->tab_label), list);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pango_attr_list_unref(list);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_label_set_attributes(GTK_LABEL(gtkconv->tab_label), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (pidgin_conv_window_is_active_conversation(conv))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 update_typing_icon(gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_label_set_text(GTK_LABEL(gtkconv->menu_label), title);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (pidgin_conv_window_is_active_conversation(conv))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_window_set_title(GTK_WINDOW(win->window), title);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(title);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_updated(PurpleConversation *conv, PurpleConvUpdateType type)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConvFields flags = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(conv != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (type == PURPLE_CONV_UPDATE_ACCOUNT)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 flags = PIDGIN_CONV_ALL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (type == PURPLE_CONV_UPDATE_TYPING ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 type == PURPLE_CONV_UPDATE_UNSEEN ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 type == PURPLE_CONV_UPDATE_TITLE)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 flags = PIDGIN_CONV_COLORIZE_TITLE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (type == PURPLE_CONV_UPDATE_TOPIC)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 flags = PIDGIN_CONV_TOPIC;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (type == PURPLE_CONV_ACCOUNT_ONLINE ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 type == PURPLE_CONV_ACCOUNT_OFFLINE)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 flags = PIDGIN_CONV_MENU | PIDGIN_CONV_TAB_ICON | PIDGIN_CONV_SET_TITLE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (type == PURPLE_CONV_UPDATE_AWAY)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 flags = PIDGIN_CONV_TAB_ICON;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (type == PURPLE_CONV_UPDATE_ADD ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 type == PURPLE_CONV_UPDATE_REMOVE ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 type == PURPLE_CONV_UPDATE_CHATLEFT)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 flags = PIDGIN_CONV_SET_TITLE | PIDGIN_CONV_MENU;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (type == PURPLE_CONV_UPDATE_ICON)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 flags = PIDGIN_CONV_BUDDY_ICON;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (type == PURPLE_CONV_UPDATE_FEATURES)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 flags = PIDGIN_CONV_MENU;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_update_fields(conv, flags);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 wrote_msg_update_unseen_cb(PurpleAccount *account, const char *who, const char *message,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv, PurpleMessageFlags flags, gpointer null)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (conv == NULL || PIDGIN_IS_PIDGIN_CONVERSATION(conv))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (flags & (PURPLE_MESSAGE_SEND | PURPLE_MESSAGE_RECV)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginUnseenState unseen = PIDGIN_UNSEEN_NONE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((flags & PURPLE_MESSAGE_NICK) == PURPLE_MESSAGE_NICK)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 unseen = PIDGIN_UNSEEN_NICK;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (((flags & PURPLE_MESSAGE_SYSTEM) == PURPLE_MESSAGE_SYSTEM) ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ((flags & PURPLE_MESSAGE_ERROR) == PURPLE_MESSAGE_ERROR))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 unseen = PIDGIN_UNSEEN_EVENT;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if ((flags & PURPLE_MESSAGE_NO_LOG) == PURPLE_MESSAGE_NO_LOG)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 unseen = PIDGIN_UNSEEN_NO_LOG;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 unseen = PIDGIN_UNSEEN_TEXT;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_set_unseen(conv, unseen);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static PurpleConversationUiOps conversation_ui_ops =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_new,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_destroy, /* destroy_conversation */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 NULL, /* write_chat */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_write_im, /* write_im */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_write_conv, /* write_conv */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_chat_add_users, /* chat_add_users */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_chat_rename_user, /* chat_rename_user */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_chat_remove_users, /* chat_remove_users */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_chat_update_user, /* chat_update_user */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_present_conversation, /* present */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_has_focus, /* has_focus */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_custom_smiley_add, /* custom_smiley_add */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_custom_smiley_write, /* custom_smiley_write */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_custom_smiley_close, /* custom_smiley_close */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_send_confirm, /* send_confirm */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 NULL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 NULL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 NULL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 NULL
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 };
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversationUiOps *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conversations_get_conv_ui_ops(void)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return &conversation_ui_ops;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /**************************************************************************
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * Public conversation utility functions
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 **************************************************************************/
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_update_buddy_icon(PurpleConversation *conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBuddy *buddy;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkPixbufLoader *loader;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkPixbufAnimation *anim;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GError *err = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleStoredImage *custom_img = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gconstpointer data = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 size_t len;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkPixbuf *buf;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *event;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkPixbuf *scale;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int scale_width, scale_height;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleAccount *account;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurplePluginProtocolInfo *prpl_info = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBuddyIcon *icon;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(conv != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(PIDGIN_IS_PIDGIN_CONVERSATION(conv));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win = gtkconv->win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (conv != gtkconv->active_conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!gtkconv->u.im->show_icon)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 account = purple_conversation_get_account(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(account && account->gc)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(account->gc->prpl);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Remove the current icon stuff */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->u.im->icon_container != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_destroy(gtkconv->u.im->icon_container);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->u.im->icon_container = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->u.im->anim != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_unref(G_OBJECT(gtkconv->u.im->anim));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->u.im->anim = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->u.im->icon_timer != 0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_source_remove(gtkconv->u.im->icon_timer);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->u.im->icon_timer = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->u.im->iter != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_unref(G_OBJECT(gtkconv->u.im->iter));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->u.im->iter = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/im/show_buddy_icons"))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_gc(conv) == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buddy = purple_find_buddy(account, purple_conversation_get_name(conv));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (buddy)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleContact *contact = purple_buddy_get_contact(buddy);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (contact) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 custom_img = purple_buddy_icons_find_custom_icon(contact);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (custom_img) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* There is a custom icon for this user */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 data = purple_imgstore_get_data(custom_img);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 len = purple_imgstore_get_size(custom_img);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (data == NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 icon = purple_conv_im_get_icon(PURPLE_CONV_IM(conv));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (icon == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 data = purple_buddy_icon_get_data(icon, &len);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (data == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 loader = gdk_pixbuf_loader_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gdk_pixbuf_loader_write(loader, data, len, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gdk_pixbuf_loader_close(loader, &err);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_imgstore_unref(custom_img);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 anim = gdk_pixbuf_loader_get_animation(loader);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (anim)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_ref(G_OBJECT(anim));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_unref(loader);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!anim)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->u.im->anim = anim;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (err) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_debug(PURPLE_DEBUG_ERROR, "gtkconv",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "Buddy icon error: %s\n", err->message);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_error_free(err);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gdk_pixbuf_animation_is_static_image(gtkconv->u.im->anim)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkPixbuf *stat;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->u.im->iter = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 stat = gdk_pixbuf_animation_get_static_image(gtkconv->u.im->anim);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buf = gdk_pixbuf_add_alpha(stat, FALSE, 0, 0, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkPixbuf *stat;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->u.im->iter =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gdk_pixbuf_animation_get_iter(gtkconv->u.im->anim, NULL); /* LEAK */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 stat = gdk_pixbuf_animation_iter_get_pixbuf(gtkconv->u.im->iter);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buf = gdk_pixbuf_add_alpha(stat, FALSE, 0, 0, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->u.im->animate)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 start_anim(NULL, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 scale_width = gdk_pixbuf_get_width(buf);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 scale_height = gdk_pixbuf_get_height(buf);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (scale_width == scale_height) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 scale_width = scale_height = 32;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (scale_height > scale_width) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 scale_width = 32 * scale_width / scale_height;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 scale_height = 32;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 scale_height = 32 * scale_height / scale_width;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 scale_width = 32;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 scale = gdk_pixbuf_scale_simple(buf, scale_width, scale_height,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GDK_INTERP_BILINEAR);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_unref(buf);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (pidgin_gdk_pixbuf_is_opaque(scale))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_gdk_pixbuf_make_round(scale);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->u.im->icon_container = gtk_vbox_new(FALSE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 event = gtk_event_box_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_container_add(GTK_CONTAINER(gtkconv->u.im->icon_container), event);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #if GTK_CHECK_VERSION(2,4,0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_event_box_set_visible_window(GTK_EVENT_BOX(event), FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_add_events(event,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GDK_POINTER_MOTION_MASK | GDK_LEAVE_NOTIFY_MASK);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(event), "button-press-event",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(icon_menu), gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_tooltip_setup_for_widget(event, gtkconv, pidgin_conv_create_tooltip, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(event);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->u.im->icon = gtk_image_new_from_pixbuf(scale);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_container_add(GTK_CONTAINER(event), gtkconv->u.im->icon);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(gtkconv->u.im->icon);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_unref(G_OBJECT(scale));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(gtkconv->infopane_hbox),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->u.im->icon_container, FALSE, FALSE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(gtkconv->u.im->icon_container);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* The buddy icon code needs badly to be fixed. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(pidgin_conv_window_is_active_conversation(conv))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buf = gdk_pixbuf_animation_get_static_image(gtkconv->u.im->anim);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_window_set_icon(GTK_WINDOW(win->window), buf);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_update_buttons_by_protocol(PurpleConversation *conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!PIDGIN_IS_PIDGIN_CONVERSATION(conv))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win = PIDGIN_CONVERSATION(conv)->win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (win != NULL && pidgin_conv_window_is_active_conversation(conv))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gray_stuff_out(PIDGIN_CONVERSATION(conv));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_get_tab_at_xy(PidginWindow *win, int x, int y, gboolean *to_right)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gint nb_x, nb_y, x_rel, y_rel;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkNotebook *notebook;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *page, *tab;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gint i, page_num = -1;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gint count;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean horiz;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (to_right)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 *to_right = FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 notebook = GTK_NOTEBOOK(win->notebook);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gdk_window_get_origin(win->notebook->window, &nb_x, &nb_y);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 x_rel = x - nb_x;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 y_rel = y - nb_y;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 horiz = (gtk_notebook_get_tab_pos(notebook) == GTK_POS_TOP ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_get_tab_pos(notebook) == GTK_POS_BOTTOM);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #if GTK_CHECK_VERSION(2,2,0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 count = gtk_notebook_get_n_pages(GTK_NOTEBOOK(notebook));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* this is hacky, but it's only for Gtk 2.0.0... */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 count = g_list_length(GTK_NOTEBOOK(notebook)->children);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (i = 0; i < count; i++) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook), i);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tab = gtk_notebook_get_tab_label(GTK_NOTEBOOK(notebook), page);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Make sure the tab is not hidden beyond an arrow */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!GTK_WIDGET_DRAWABLE(tab))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 continue;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (horiz) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (x_rel >= tab->allocation.x - PIDGIN_HIG_BOX_SPACE &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 x_rel <= tab->allocation.x + tab->allocation.width + PIDGIN_HIG_BOX_SPACE) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 page_num = i;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (to_right && x_rel >= tab->allocation.x + tab->allocation.width/2)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 *to_right = TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (y_rel >= tab->allocation.y - PIDGIN_HIG_BOX_SPACE &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 y_rel <= tab->allocation.y + tab->allocation.height + PIDGIN_HIG_BOX_SPACE) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 page_num = i;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (to_right && y_rel >= tab->allocation.y + tab->allocation.height/2)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 *to_right = TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (page_num == -1) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Add after the last tab */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 page_num = count - 1;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return page_num;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 close_on_tabs_pref_cb(const char *name, PurplePrefType type,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gconstpointer value, gpointer data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *l;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (l = purple_get_conversations(); l != NULL; l = l->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = (PurpleConversation *)l->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!PIDGIN_IS_PIDGIN_CONVERSATION(conv))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 continue;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (value)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(gtkconv->close);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_hide(gtkconv->close);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 spellcheck_pref_cb(const char *name, PurplePrefType type,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gconstpointer value, gpointer data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #ifdef USE_GTKSPELL
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *cl;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkSpell *spell;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (cl = purple_get_conversations(); cl != NULL; cl = cl->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = (PurpleConversation *)cl->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!PIDGIN_IS_PIDGIN_CONVERSATION(conv))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 continue;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (value)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_setup_gtkspell(GTK_TEXT_VIEW(gtkconv->entry));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 spell = gtkspell_get_from_text_view(GTK_TEXT_VIEW(gtkconv->entry));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkspell_detach(spell);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tab_side_pref_cb(const char *name, PurplePrefType type,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gconstpointer value, gpointer data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *gtkwins, *gtkconvs;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkPositionType pos;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *gtkwin;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pos = GPOINTER_TO_INT(value);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (gtkwins = pidgin_conv_windows_get_list(); gtkwins != NULL; gtkwins = gtkwins->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkwin = gtkwins->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(gtkwin->notebook), pos&~8);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (gtkconvs = gtkwin->gtkconvs; gtkconvs != NULL; gtkconvs = gtkconvs->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_tab_pack(gtkwin, gtkconvs->data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 show_timestamps_pref_cb(const char *name, PurplePrefType type,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gconstpointer value, gpointer data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *l;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (l = purple_get_conversations(); l != NULL; l = l->next)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = (PurpleConversation *)l->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!PIDGIN_IS_PIDGIN_CONVERSATION(conv))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 continue;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win = gtkconv->win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_check_menu_item_set_active(
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_CHECK_MENU_ITEM(win->menu.show_timestamps),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (gboolean)GPOINTER_TO_INT(value));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_show_comments(GTK_IMHTML(gtkconv->imhtml),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (gboolean)GPOINTER_TO_INT(value));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 show_formatting_toolbar_pref_cb(const char *name, PurplePrefType type,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gconstpointer value, gpointer data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *l;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (l = purple_get_conversations(); l != NULL; l = l->next)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = (PurpleConversation *)l->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!PIDGIN_IS_PIDGIN_CONVERSATION(conv))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 continue;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win = gtkconv->win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_check_menu_item_set_active(
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_CHECK_MENU_ITEM(win->menu.show_formatting_toolbar),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (gboolean)GPOINTER_TO_INT(value));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((gboolean)GPOINTER_TO_INT(value))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(gtkconv->toolbar);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_hide(gtkconv->toolbar);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_idle_add((GSourceFunc)resize_imhtml_cb,gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 animate_buddy_icons_pref_cb(const char *name, PurplePrefType type,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gconstpointer value, gpointer data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *l;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/im/show_buddy_icons"))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Set the "animate" flag for each icon based on the new preference */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (l = purple_get_ims(); l != NULL; l = l->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = (PurpleConversation *)l->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->u.im->animate = GPOINTER_TO_INT(value);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Now either stop or start animation for the active conversation in each window */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (l = pidgin_conv_windows_get_list(); l != NULL; l = l->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win = l->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = pidgin_conv_window_get_active_conversation(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_update_buddy_icon(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 show_buddy_icons_pref_cb(const char *name, PurplePrefType type,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gconstpointer value, gpointer data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *l;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (l = purple_get_conversations(); l != NULL; l = l->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = l->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!PIDGIN_CONVERSATION(conv))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 continue;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (GPOINTER_TO_INT(value))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(PIDGIN_CONVERSATION(conv)->infopane_hbox);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_hide(PIDGIN_CONVERSATION(conv)->infopane_hbox);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_update_buddy_icon(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 show_protocol_icons_pref_cb(const char *name, PurplePrefType type,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gconstpointer value, gpointer data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *l;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (l = purple_get_conversations(); l != NULL; l = l->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = l->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (PIDGIN_CONVERSATION(conv))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 update_tab_icon(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_placement_usetabs_cb(const char *name, PurplePrefType type,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gconstpointer value, gpointer data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_trigger_callback(PIDGIN_PREFS_ROOT "/conversations/placement");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 account_status_changed_cb(PurpleAccount *account, PurpleStatus *oldstatus,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleStatus *newstatus)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *l;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new"), "away")!=0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(purple_status_is_available(oldstatus) || !purple_status_is_available(newstatus))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 while ((l = hidden_convwin->gtkconvs) != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = l->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 while(l && !purple_status_is_available(
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_account_get_active_status(
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_get_account(conv))))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 l = l->next;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!l)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_remove_gtkconv(hidden_convwin, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_placement_place(gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* TODO: do we need to do anything for any other conversations that are in the same gtkconv here?
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * I'm a little concerned that not doing so will cause the "pending" indicator in the gtkblist not to be cleared. -DAA*/
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_update(conv, PURPLE_CONV_UPDATE_UNSEEN);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 hide_new_pref_cb(const char *name, PurplePrefType type,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gconstpointer value, gpointer data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *l;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean when_away = FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(!hidden_convwin)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new"), "always")==0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new"), "away")==0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 when_away = TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (l = hidden_convwin->gtkconvs; l; )
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = l->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 l = l->next;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (conv->type == PURPLE_CONV_TYPE_CHAT ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->unseen_count == 0 ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (when_away && !purple_status_is_available(
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_account_get_active_status(
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_get_account(conv)))))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 continue;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_remove_gtkconv(hidden_convwin, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_placement_place(gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_placement_pref_cb(const char *name, PurplePrefType type,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gconstpointer value, gpointer data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConvPlacementFunc func;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (strcmp(name, PIDGIN_PREFS_ROOT "/conversations/placement"))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 func = pidgin_conv_placement_get_fnc(value);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (func == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_placement_set_current_func(func);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static PidginConversation *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 get_gtkconv_with_contact(PurpleContact *contact)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBlistNode *node;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 node = ((PurpleBlistNode*)contact)->child;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (; node; node = node->next)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBuddy *buddy = (PurpleBuddy*)node;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, buddy->name, buddy->account);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 account_signed_off_cb(PurpleConnection *gc, gpointer event)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *iter;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (iter = purple_get_conversations(); iter; iter = iter->next)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = iter->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* This seems fine in theory, but we also need to cover the
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * case of this account matching one of the other buddies in
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * one of the contacts containing the buddy corresponding to
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * a conversation. It's easier to just update them all. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* if (purple_conversation_get_account(conv) == account) */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_update_fields(conv, PIDGIN_CONV_TAB_ICON |
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PIDGIN_CONV_MENU | PIDGIN_CONV_COLORIZE_TITLE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (PURPLE_CONNECTION_IS_CONNECTED(gc) &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv->type == PURPLE_CONV_TYPE_CHAT &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv->account == gc->account &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_get_data(conv, "want-to-rejoin")) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GHashTable *comps = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleChat *chat = purple_blist_find_chat(conv->account, conv->name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (chat == NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info_defaults != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 comps = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info_defaults(gc, conv->name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 comps = chat->components;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 serv_join_chat(gc, comps);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (chat == NULL && comps != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_hash_table_destroy(comps);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 update_buddy_status_timeout(PurpleBuddy *buddy)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* To remove the signing-on/off door icon */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, buddy->name, buddy->account);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_update_fields(conv, PIDGIN_CONV_TAB_ICON);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 update_buddy_status_changed(PurpleBuddy *buddy, PurpleStatus *old, PurpleStatus *newstatus)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = get_gtkconv_with_contact(purple_buddy_get_contact(buddy));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_update_fields(conv, PIDGIN_CONV_TAB_ICON | PIDGIN_CONV_COLORIZE_TITLE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((purple_status_is_online(old) ^ purple_status_is_online(newstatus)) != 0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_update_fields(conv, PIDGIN_CONV_MENU);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* In case a conversation is started after the buddy has signed-on/off */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_timeout_add(11000, (GSourceFunc)update_buddy_status_timeout, buddy);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 update_buddy_privacy_changed(PurpleBuddy *buddy)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = get_gtkconv_with_contact(purple_buddy_get_contact(buddy));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_update_fields(conv, PIDGIN_CONV_TAB_ICON | PIDGIN_CONV_MENU);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 update_buddy_idle_changed(PurpleBuddy *buddy, gboolean old, gboolean newidle)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, buddy->name, buddy->account);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_update_fields(conv, PIDGIN_CONV_TAB_ICON);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 update_buddy_icon(PurpleBuddy *buddy)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, buddy->name, buddy->account);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_update_fields(conv, PIDGIN_CONV_BUDDY_ICON);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 update_buddy_sign(PurpleBuddy *buddy, const char *which)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurplePresence *presence;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleStatus *on, *off;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 presence = purple_buddy_get_presence(buddy);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!presence)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 off = purple_presence_get_status(presence, "offline");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 on = purple_presence_get_status(presence, "available");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (*(which+1) == 'f')
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 update_buddy_status_changed(buddy, on, off);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 update_buddy_status_changed(buddy, off, on);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 update_conversation_switched(PurpleConversation *conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_update_fields(conv, PIDGIN_CONV_TAB_ICON | PIDGIN_CONV_SET_TITLE |
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PIDGIN_CONV_MENU | PIDGIN_CONV_BUDDY_ICON);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 update_buddy_typing(PurpleAccount *account, const char *who)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, who, account);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv && gtkconv->active_conv == conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_update_fields(conv, PIDGIN_CONV_COLORIZE_TITLE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 update_chat(PurpleConversation *conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_update_fields(conv, PIDGIN_CONV_TOPIC |
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PIDGIN_CONV_MENU | PIDGIN_CONV_SET_TITLE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 update_chat_topic(PurpleConversation *conv, const char *old, const char *new)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_update_fields(conv, PIDGIN_CONV_TOPIC);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Message history stuff */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Compare two PurpleConvMessage's, according to time in ascending order. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static int
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 message_compare(gconstpointer p1, gconstpointer p2)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const PurpleConvMessage *m1 = p1, *m2 = p2;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return (m1->when > m2->when);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Adds some message history to the gtkconv. This happens in a idle-callback. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 add_message_history_to_gtkconv(gpointer data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv = data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int count = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int timer = gtkconv->attach.timer;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 time_t when = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(gtkconv->entry), "attach-start-time"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean im = (gtkconv->active_conv->type == PURPLE_CONV_TYPE_IM);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->attach.timer = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 while (gtkconv->attach.current && count < 100) { /* XXX: 100 is a random value here */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConvMessage *msg = gtkconv->attach.current->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!im && when && when < msg->when) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), "<BR><HR>", 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set_data(G_OBJECT(gtkconv->entry), "attach-start-time", NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_write_conv(msg->conv, msg->who, msg->alias, msg->what, msg->flags, msg->when);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (im) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->attach.current = g_list_delete_link(gtkconv->attach.current, gtkconv->attach.current);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->attach.current = gtkconv->attach.current->prev;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 count++;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->attach.timer = timer;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->attach.current)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_source_remove(gtkconv->attach.timer);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->attach.timer = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (im) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Print any message that was sent while the old history was being added back. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *msgs = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *iter = gtkconv->convs;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (; iter; iter = iter->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = iter->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *history = purple_conversation_get_message_history(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (; history; history = history->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConvMessage *msg = history->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (msg->when > when)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 msgs = g_list_prepend(msgs, msg);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 msgs = g_list_sort(msgs, message_compare);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (; msgs; msgs = g_list_delete_link(msgs, msgs)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConvMessage *msg = msgs->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_write_conv(msg->conv, msg->who, msg->alias, msg->what, msg->flags, msg->when);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), "<BR><HR>", 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set_data(G_OBJECT(gtkconv->entry), "attach-start-time", NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set_data(G_OBJECT(gtkconv->entry), "attach-start-time", NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_emit(pidgin_conversations_get_handle(),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "conversation-displayed", gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_attach(PurpleConversation *conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int timer;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_set_data(conv, "unseen-count", NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_set_data(conv, "unseen-state", NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_set_ui_ops(conv, pidgin_conversations_get_conv_ui_ops());
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!PIDGIN_CONVERSATION(conv))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 private_gtkconv_new(conv, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 timer = GPOINTER_TO_INT(purple_conversation_get_data(conv, "close-timer"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (timer) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_timeout_remove(timer);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_set_data(conv, "close-timer", NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean pidgin_conv_attach_to_conversation(PurpleConversation *conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *list;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (PIDGIN_IS_PIDGIN_CONVERSATION(conv)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* This is pretty much always the case now. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->win != hidden_convwin)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_remove_gtkconv(hidden_convwin, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_placement_place(gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_emit(pidgin_conversations_get_handle(),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "conversation-displayed", gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 list = gtkconv->convs;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 while (list) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_attach(list->data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 list = list->next;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_attach(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 list = purple_conversation_get_message_history(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (list) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 switch (purple_conversation_get_type(conv)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case PURPLE_CONV_TYPE_IM:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *convs;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 list = g_list_copy(list);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (convs = purple_get_ims(); convs; convs = convs->next)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (convs->data != conv &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_find_gtkconv(convs->data) == gtkconv) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_attach(convs->data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 list = g_list_concat(list, g_list_copy(purple_conversation_get_message_history(convs->data)));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 list = g_list_sort(list, message_compare);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->attach.current = list;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 list = g_list_last(list);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case PURPLE_CONV_TYPE_CHAT:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->attach.current = g_list_last(list);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 default:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_val_if_reached(TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set_data(G_OBJECT(gtkconv->entry), "attach-start-time",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GINT_TO_POINTER(((PurpleConvMessage*)(list->data))->when));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->attach.timer = g_idle_add(add_message_history_to_gtkconv, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_emit(pidgin_conversations_get_handle(),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "conversation-displayed", gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (conv->type == PURPLE_CONV_TYPE_CHAT) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_update_fields(conv, PIDGIN_CONV_TOPIC);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_chat_add_users(conv, PURPLE_CONV_CHAT(conv)->in_room, TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 void *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conversations_get_handle(void)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static int handle;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return &handle;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conversations_init(void)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 void *handle = pidgin_conversations_get_handle();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 void *blist_handle = purple_blist_get_handle();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Conversations */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/conversations");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/use_smooth_scrolling", TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/close_on_tabs", TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold", FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic", FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline", FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/spellcheck", TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting", TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/show_timestamps", TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/show_formatting_toolbar", TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/conversations/placement", "last");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/placement_number", 1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/conversations/bgcolor", "");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/conversations/fgcolor", "");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/conversations/font_face", "");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/font_size", 3);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/tabs", TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/tab_side", GTK_POS_TOP);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/scrollback_lines", 4000);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/use_theme_font", TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/conversations/custom_font", "");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Conversations -> Chat */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/conversations/chat");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/chat/entry_height", 54);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/chat/userlist_width", 80);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/chat/x", 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/chat/y", 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/chat/width", 340);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/chat/height", 390);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Conversations -> IM */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/conversations/im");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/im/x", 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/im/y", 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/im/width", 340);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/im/height", 390);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/im/animate_buddy_icons", TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/im/entry_height", 54);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/im/show_buddy_icons", TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new", "never");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #ifdef _WIN32
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/win32/minimize_new_convs", FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Connect callbacks. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/close_on_tabs",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 close_on_tabs_pref_cb, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/show_timestamps",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 show_timestamps_pref_cb, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/show_formatting_toolbar",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 show_formatting_toolbar_pref_cb, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/spellcheck",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 spellcheck_pref_cb, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/tab_side",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tab_side_pref_cb, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/tabs",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_placement_usetabs_cb, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/placement",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_placement_pref_cb, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_trigger_callback(PIDGIN_PREFS_ROOT "/conversations/placement");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* IM callbacks */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/im/animate_buddy_icons",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 animate_buddy_icons_pref_cb, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/im/show_buddy_icons",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 show_buddy_icons_pref_cb, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/im/show_protocol_icons",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 show_protocol_icons_pref_cb, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/im/hide_new",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 hide_new_pref_cb, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /**********************************************************************
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * Register signals
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 **********************************************************************/
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_register(handle, "conversation-dragging",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_marshal_VOID__POINTER_POINTER, NULL, 2,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new(PURPLE_TYPE_BOXED,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "PidginWindow *"),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new(PURPLE_TYPE_BOXED,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "PidginWindow *"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_register(handle, "conversation-timestamp",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #if SIZEOF_TIME_T == 4
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_marshal_POINTER__POINTER_INT_BOOLEAN,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #elif SIZEOF_TIME_T == 8
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_marshal_POINTER__POINTER_INT64_BOOLEAN,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #error Unkown size of time_t
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new(PURPLE_TYPE_STRING), 3,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new(PURPLE_TYPE_SUBTYPE,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_SUBTYPE_CONVERSATION),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #if SIZEOF_TIME_T == 4
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new(PURPLE_TYPE_INT),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #elif SIZEOF_TIME_T == 8
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new(PURPLE_TYPE_INT64),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 # error Unknown size of time_t
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new(PURPLE_TYPE_BOOLEAN));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_register(handle, "displaying-im-msg",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_POINTER,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new(PURPLE_TYPE_BOOLEAN), 5,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new(PURPLE_TYPE_SUBTYPE,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_SUBTYPE_ACCOUNT),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new(PURPLE_TYPE_STRING),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new_outgoing(PURPLE_TYPE_STRING),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new(PURPLE_TYPE_SUBTYPE,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_SUBTYPE_CONVERSATION),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new(PURPLE_TYPE_INT));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_register(handle, "displayed-im-msg",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_marshal_VOID__POINTER_POINTER_POINTER_POINTER_UINT,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 NULL, 5,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new(PURPLE_TYPE_SUBTYPE,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_SUBTYPE_ACCOUNT),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new(PURPLE_TYPE_STRING),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new(PURPLE_TYPE_STRING),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new(PURPLE_TYPE_SUBTYPE,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_SUBTYPE_CONVERSATION),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new(PURPLE_TYPE_INT));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_register(handle, "displaying-chat-msg",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_POINTER,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new(PURPLE_TYPE_BOOLEAN), 5,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new(PURPLE_TYPE_SUBTYPE,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_SUBTYPE_ACCOUNT),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new(PURPLE_TYPE_STRING),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new_outgoing(PURPLE_TYPE_STRING),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new(PURPLE_TYPE_SUBTYPE,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_SUBTYPE_CONVERSATION),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new(PURPLE_TYPE_INT));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_register(handle, "displayed-chat-msg",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_marshal_VOID__POINTER_POINTER_POINTER_POINTER_UINT,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 NULL, 5,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new(PURPLE_TYPE_SUBTYPE,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_SUBTYPE_ACCOUNT),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new(PURPLE_TYPE_STRING),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new(PURPLE_TYPE_STRING),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new(PURPLE_TYPE_SUBTYPE,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_SUBTYPE_CONVERSATION),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new(PURPLE_TYPE_INT));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_register(handle, "conversation-switched",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_marshal_VOID__POINTER, NULL, 1,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new(PURPLE_TYPE_SUBTYPE,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_SUBTYPE_CONVERSATION));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_register(handle, "conversation-hiding",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_marshal_VOID__POINTER, NULL, 1,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new(PURPLE_TYPE_BOXED,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "PidginConversation *"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_register(handle, "conversation-displayed",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_marshal_VOID__POINTER, NULL, 1,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_value_new(PURPLE_TYPE_BOXED,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "PidginConversation *"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /**********************************************************************
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * Register commands
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 **********************************************************************/
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_cmd_register("say", "S", PURPLE_CMD_P_DEFAULT,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_IM, NULL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 say_command_cb, _("say <message>: Send a message normally as if you weren't using a command."), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_cmd_register("me", "S", PURPLE_CMD_P_DEFAULT,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_IM, NULL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 me_command_cb, _("me <action>: Send an IRC style action to a buddy or chat."), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_cmd_register("debug", "w", PURPLE_CMD_P_DEFAULT,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_IM, NULL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 debug_command_cb, _("debug <option>: Send various debug information to the current conversation."), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_cmd_register("clear", "", PURPLE_CMD_P_DEFAULT,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_IM, NULL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 clear_command_cb, _("clear: Clears the conversation scrollback."), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_cmd_register("clearall", "", PURPLE_CMD_P_DEFAULT,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_IM, NULL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 clearall_command_cb, _("clear: Clears all conversation scrollbacks."), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_cmd_register("help", "w", PURPLE_CMD_P_DEFAULT,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, NULL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 help_command_cb, _("help <command>: Help on a specific command."), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /**********************************************************************
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * UI operations
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 **********************************************************************/
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_connect(purple_connections_get_handle(), "signed-on", handle,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(account_signed_off_cb),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GINT_TO_POINTER(PURPLE_CONV_ACCOUNT_ONLINE));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_connect(purple_connections_get_handle(), "signed-off", handle,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(account_signed_off_cb),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GINT_TO_POINTER(PURPLE_CONV_ACCOUNT_OFFLINE));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_connect(purple_conversations_get_handle(), "received-im-msg",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 handle, G_CALLBACK(received_im_msg_cb), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversations_set_ui_ops(&conversation_ui_ops);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 hidden_convwin = pidgin_conv_window_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 window_list = g_list_remove(window_list, hidden_convwin);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_connect(purple_accounts_get_handle(), "account-status-changed",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 handle, PURPLE_CALLBACK(account_status_changed_cb), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Callbacks to update a conversation */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_connect(blist_handle, "buddy-added", handle,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(buddy_update_cb), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_connect(blist_handle, "buddy-removed", handle,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(buddy_update_cb), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_connect(blist_handle, "buddy-signed-on",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 handle, PURPLE_CALLBACK(update_buddy_sign), "on");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_connect(blist_handle, "buddy-signed-off",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 handle, PURPLE_CALLBACK(update_buddy_sign), "off");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_connect(blist_handle, "buddy-status-changed",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 handle, PURPLE_CALLBACK(update_buddy_status_changed), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_connect(blist_handle, "buddy-privacy-changed",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 handle, PURPLE_CALLBACK(update_buddy_privacy_changed), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_connect(blist_handle, "buddy-idle-changed",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 handle, PURPLE_CALLBACK(update_buddy_idle_changed), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_connect(blist_handle, "buddy-icon-changed",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 handle, PURPLE_CALLBACK(update_buddy_icon), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_connect(purple_conversations_get_handle(), "buddy-typing",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 handle, PURPLE_CALLBACK(update_buddy_typing), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_connect(purple_conversations_get_handle(), "buddy-typing-stopped",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 handle, PURPLE_CALLBACK(update_buddy_typing), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_connect(pidgin_conversations_get_handle(), "conversation-switched",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 handle, PURPLE_CALLBACK(update_conversation_switched), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_connect(purple_conversations_get_handle(), "chat-left", handle,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_CALLBACK(update_chat), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_connect(purple_conversations_get_handle(), "chat-joined", handle,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_CALLBACK(update_chat), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_connect(purple_conversations_get_handle(), "chat-topic-changed", handle,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_CALLBACK(update_chat_topic), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_connect_priority(purple_conversations_get_handle(), "conversation-updated", handle,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_CALLBACK(pidgin_conv_updated), NULL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_SIGNAL_PRIORITY_LOWEST);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_connect(purple_conversations_get_handle(), "wrote-im-msg", handle,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_CALLBACK(wrote_msg_update_unseen_cb), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_connect(purple_conversations_get_handle(), "wrote-chat-msg", handle,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PURPLE_CALLBACK(wrote_msg_update_unseen_cb), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Set default tab colors */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GString *str = g_string_new(NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkSettings *settings = gtk_settings_get_default();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkStyle *parent = gtk_rc_get_style_by_paths(settings, "tab-container.tab-label*", NULL, G_TYPE_NONE), *now;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 struct {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *stylename;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *labelname;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *color;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } styles[] = {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {"pidgin_tab_label_typing_default", "tab-label-typing", "#4e9a06"},
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {"pidgin_tab_label_typed_default", "tab-label-typed", "#c4a000"},
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {"pidgin_tab_label_attention_default", "tab-label-attention", "#006aff"},
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {"pidgin_tab_label_unreadchat_default", "tab-label-unreadchat", "#cc0000"},
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {"pidgin_tab_label_event_default", "tab-label-event", "#888a85"},
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {NULL, NULL, NULL}
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 };
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int iter;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (iter = 0; styles[iter].stylename; iter++) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 now = gtk_rc_get_style_by_paths(settings, styles[iter].labelname, NULL, G_TYPE_NONE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (parent == now ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (parent && now && parent->rc_style == now->rc_style)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_string_append_printf(str, "style \"%s\" {\n"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "fg[ACTIVE] = \"%s\"\n"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "}\n"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "widget \"*%s\" style \"%s\"\n",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 styles[iter].stylename,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 styles[iter].color,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 styles[iter].labelname, styles[iter].stylename);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_rc_parse_string(str->str);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_string_free(str, TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #if GTK_CHECK_VERSION(2,4,0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_rc_reset_styles(settings);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conversations_uninit(void)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_disconnect_by_handle(pidgin_conversations_get_handle());
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signals_disconnect_by_handle(pidgin_conversations_get_handle());
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signals_unregister_by_instance(pidgin_conversations_get_handle());
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* down here is where gtkconvwin.c ought to start. except they share like every freaking function,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * and touch each others' private members all day long */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /**
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * @file gtkconvwin.c GTK+ Conversation Window API
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * @ingroup pidgin
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * pidgin
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * Pidgin is the legal property of its developers, whose names are too numerous
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * to list here. Please refer to the COPYRIGHT file distributed with this
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * source distribution.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * This program is free software; you can redistribute it and/or modify
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * it under the terms of the GNU General Public License as published by
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * the Free Software Foundation; either version 2 of the License, or
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * (at your option) any later version.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * This program is distributed in the hope that it will be useful,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * GNU General Public License for more details.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * You should have received a copy of the GNU General Public License
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * along with this program; if not, write to the Free Software
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "internal.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "pidgin.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include <gdk/gdkkeysyms.h>
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "account.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "cmds.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "debug.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "imgstore.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "log.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "notify.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "prpl.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "request.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "util.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "gtkdnd-hints.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "gtkblist.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "gtkconv.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "gtkdialogs.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "gtkmenutray.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "gtkpounce.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "gtkprefs.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "gtkprivacy.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "gtkutils.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "pidginstock.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "gtkimhtml.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "gtkimhtmltoolbar.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 do_close(GtkWidget *w, int resp, PidginWindow *win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_destroy(warn_close_dialog);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 warn_close_dialog = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (resp == GTK_RESPONSE_OK)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_destroy(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 build_warn_close_dialog(PidginWindow *gtkwin)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *label;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *vbox, *hbox;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *img;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(warn_close_dialog == NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 warn_close_dialog = gtk_dialog_new_with_buttons(
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 _("Confirm close"),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_WINDOW(gtkwin->window), GTK_DIALOG_MODAL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_STOCK_CLOSE, GTK_RESPONSE_OK, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_dialog_set_default_response(GTK_DIALOG(warn_close_dialog),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_RESPONSE_OK);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_container_set_border_width(GTK_CONTAINER(warn_close_dialog),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 6);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_window_set_resizable(GTK_WINDOW(warn_close_dialog), FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_dialog_set_has_separator(GTK_DIALOG(warn_close_dialog),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Setup the outside spacing. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 vbox = GTK_DIALOG(warn_close_dialog)->vbox;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_set_spacing(GTK_BOX(vbox), 12);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_container_set_border_width(GTK_CONTAINER(vbox), 6);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 img = gtk_image_new_from_stock(PIDGIN_STOCK_DIALOG_WARNING,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_HUGE));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Setup the inner hbox and put the dialog's icon in it. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 hbox = gtk_hbox_new(FALSE, 12);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_container_add(GTK_CONTAINER(vbox), hbox);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_misc_set_alignment(GTK_MISC(img), 0, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Setup the right vbox. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 vbox = gtk_vbox_new(FALSE, 12);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_container_add(GTK_CONTAINER(hbox), vbox);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 label = gtk_label_new(_("You have unread messages. Are you sure you want to close the window?"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_size_request(label, 350, -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Connect the signals. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(warn_close_dialog), "response",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(do_close), gtkwin);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /**************************************************************************
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * Callbacks
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 **************************************************************************/
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 close_win_cb(GtkWidget *w, GdkEventAny *e, gpointer d)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win = d;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *l;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* If there are unread messages then show a warning dialog */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (l = pidgin_conv_window_get_gtkconvs(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 l != NULL; l = l->next)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv = l->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(gtkconv->active_conv) == PURPLE_CONV_TYPE_IM &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->unseen_state >= PIDGIN_UNSEEN_TEXT)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 build_warn_close_dialog(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show_all(warn_close_dialog);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_destroy(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_set_unseen(PurpleConversation *conv, PidginUnseenState state)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int unseen_count = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginUnseenState unseen_state = PIDGIN_UNSEEN_NONE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(purple_conversation_get_data(conv, "unseen-count"))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 unseen_count = GPOINTER_TO_INT(purple_conversation_get_data(conv, "unseen-count"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(purple_conversation_get_data(conv, "unseen-state"))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 unseen_state = GPOINTER_TO_INT(purple_conversation_get_data(conv, "unseen-state"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (state == PIDGIN_UNSEEN_NONE)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 unseen_count = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 unseen_state = PIDGIN_UNSEEN_NONE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (state >= PIDGIN_UNSEEN_TEXT)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 unseen_count++;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (state > unseen_state)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 unseen_state = state;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_set_data(conv, "unseen-count", GINT_TO_POINTER(unseen_count));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_set_data(conv, "unseen-state", GINT_TO_POINTER(unseen_state));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_update(conv, PURPLE_CONV_UPDATE_UNSEEN);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv_set_unseen(PidginConversation *gtkconv, PidginUnseenState state)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (state == PIDGIN_UNSEEN_NONE)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->unseen_count = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->unseen_state = PIDGIN_UNSEEN_NONE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (state >= PIDGIN_UNSEEN_TEXT)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->unseen_count++;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (state > gtkconv->unseen_state)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->unseen_state = state;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_update(gtkconv->active_conv, PURPLE_CONV_UPDATE_UNSEEN);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /*
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * When a conversation window is focused, we know the user
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * has looked at it so we know there are no longer unseen
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * messages.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 focus_win_cb(GtkWidget *w, GdkEventFocus *e, gpointer d)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win = d;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv = pidgin_conv_window_get_active_gtkconv(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv_set_unseen(gtkconv, PIDGIN_UNSEEN_NONE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #if !GTK_CHECK_VERSION(2,6,0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Courtesy of Galeon! */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tab_close_button_state_changed_cb(GtkWidget *widget, GtkStateType prev_state)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (GTK_WIDGET_STATE(widget) == GTK_STATE_ACTIVE)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_state(widget, GTK_STATE_NORMAL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 notebook_init_grab(PidginWindow *gtkwin, GtkWidget *widget)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GdkCursor *cursor = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkwin->in_drag = TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkwin->drag_leave_signal) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_handler_disconnect(G_OBJECT(widget),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkwin->drag_leave_signal);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkwin->drag_leave_signal = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (cursor == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 cursor = gdk_cursor_new(GDK_FLEUR);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Grab the pointer */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_grab_add(gtkwin->notebook);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #ifndef _WIN32
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Currently for win32 GTK+ (as of 2.2.1), gdk_pointer_is_grabbed will
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 always be true after a button press. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!gdk_pointer_is_grabbed())
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gdk_pointer_grab(gtkwin->notebook->window, FALSE,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GDK_BUTTON1_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 NULL, cursor, GDK_CURRENT_TIME);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 notebook_motion_cb(GtkWidget *widget, GdkEventButton *e, PidginWindow *win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /*
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * Make sure the user moved the mouse far enough for the
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * drag to be initiated.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (win->in_predrag) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (e->x_root < win->drag_min_x ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 e->x_root >= win->drag_max_x ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 e->y_root < win->drag_min_y ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 e->y_root >= win->drag_max_y) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->in_predrag = FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 notebook_init_grab(win, widget);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else { /* Otherwise, draw the arrows. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *dest_win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkNotebook *dest_notebook;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *tab;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gint page_num;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean horiz_tabs = FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean to_right = FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Get the window that the cursor is over. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 dest_win = pidgin_conv_window_get_at_xy(e->x_root, e->y_root);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (dest_win == NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 dnd_hints_hide_all();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 dest_notebook = GTK_NOTEBOOK(dest_win->notebook);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 page_num = pidgin_conv_get_tab_at_xy(dest_win,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 e->x_root, e->y_root, &to_right);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 to_right = to_right && (win != dest_win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtk_notebook_get_tab_pos(dest_notebook) == GTK_POS_TOP ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_get_tab_pos(dest_notebook) == GTK_POS_BOTTOM) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 horiz_tabs = TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = pidgin_conv_window_get_gtkconv_at_index(dest_win, page_num);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tab = gtkconv->tabby;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtk_notebook_get_show_tabs(dest_notebook) == FALSE) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 dnd_hints_show_relative(HINT_ARROW_DOWN, gtkconv->infopane, HINT_POSITION_CENTER, HINT_POSITION_TOP);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 dnd_hints_show_relative(HINT_ARROW_UP, gtkconv->infopane, HINT_POSITION_CENTER, HINT_POSITION_BOTTOM);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (horiz_tabs) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (((gpointer)win == (gpointer)dest_win && win->drag_tab < page_num) || to_right) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 dnd_hints_show_relative(HINT_ARROW_DOWN, tab, HINT_POSITION_RIGHT, HINT_POSITION_TOP);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 dnd_hints_show_relative(HINT_ARROW_UP, tab, HINT_POSITION_RIGHT, HINT_POSITION_BOTTOM);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 dnd_hints_show_relative(HINT_ARROW_DOWN, tab, HINT_POSITION_LEFT, HINT_POSITION_TOP);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 dnd_hints_show_relative(HINT_ARROW_UP, tab, HINT_POSITION_LEFT, HINT_POSITION_BOTTOM);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (((gpointer)win == (gpointer)dest_win && win->drag_tab < page_num) || to_right) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 dnd_hints_show_relative(HINT_ARROW_RIGHT, tab, HINT_POSITION_LEFT, HINT_POSITION_BOTTOM);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 dnd_hints_show_relative(HINT_ARROW_LEFT, tab, HINT_POSITION_RIGHT, HINT_POSITION_BOTTOM);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 dnd_hints_show_relative(HINT_ARROW_RIGHT, tab, HINT_POSITION_LEFT, HINT_POSITION_TOP);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 dnd_hints_show_relative(HINT_ARROW_LEFT, tab, HINT_POSITION_RIGHT, HINT_POSITION_TOP);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 notebook_leave_cb(GtkWidget *widget, GdkEventCrossing *e, PidginWindow *win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (win->in_drag)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (e->x_root < win->drag_min_x ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 e->x_root >= win->drag_max_x ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 e->y_root < win->drag_min_y ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 e->y_root >= win->drag_max_y) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->in_predrag = FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 notebook_init_grab(win, widget);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /*
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * THANK YOU GALEON!
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 infopane_press_cb(GtkWidget *widget, GdkEventButton *e, PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (e->type == GDK_2BUTTON_PRESS && e->button == 1) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (infopane_entry_activate(gtkconv))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (e->type != GDK_BUTTON_PRESS)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (e->button == 1) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int nb_x, nb_y;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->win->in_drag)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->win->in_predrag = TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->win->drag_tab = gtk_notebook_page_num(GTK_NOTEBOOK(gtkconv->win->notebook), gtkconv->tab_cont);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gdk_window_get_origin(gtkconv->infopane_hbox->window, &nb_x, &nb_y);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->win->drag_min_x = gtkconv->infopane_hbox->allocation.x + nb_x;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->win->drag_min_y = gtkconv->infopane_hbox->allocation.y + nb_y;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->win->drag_max_x = gtkconv->infopane_hbox->allocation.width + gtkconv->win->drag_min_x;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->win->drag_max_y = gtkconv->infopane_hbox->allocation.height + gtkconv->win->drag_min_y;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->win->drag_motion_signal = g_signal_connect(G_OBJECT(gtkconv->win->notebook), "motion_notify_event",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(notebook_motion_cb), gtkconv->win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->win->drag_leave_signal = g_signal_connect(G_OBJECT(gtkconv->win->notebook), "leave_notify_event",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(notebook_leave_cb), gtkconv->win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (e->button == 3) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Right click was pressed. Popup the context menu. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *menu = gtk_menu_new(), *sub;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean populated = populate_menu_with_options(menu, gtkconv, TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 sub = gtk_menu_item_get_submenu(GTK_MENU_ITEM(gtkconv->win->menu.send_to));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (sub && GTK_WIDGET_IS_SENSITIVE(gtkconv->win->menu.send_to)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *item = gtk_menu_item_new_with_mnemonic(_("S_end To"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (populated)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_separator(menu);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), sub);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(item);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show_all(sub);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (!populated) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_destroy(menu);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show_all(menu);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, e->button, e->time);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 notebook_press_cb(GtkWidget *widget, GdkEventButton *e, PidginWindow *win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gint nb_x, nb_y, x_rel, y_rel;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int tab_clicked;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *page;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *tab;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (e->button == 2 && e->type == GDK_BUTTON_PRESS) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tab_clicked = pidgin_conv_get_tab_at_xy(win, e->x_root, e->y_root, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (tab_clicked == -1)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = pidgin_conv_window_get_gtkconv_at_index(win, tab_clicked);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 close_conv_cb(NULL, NULL, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (e->button != 1 || e->type != GDK_BUTTON_PRESS)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (win->in_drag) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_debug(PURPLE_DEBUG_WARNING, "gtkconv",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "Already in the middle of a window drag at tab_press_cb\n");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /*
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * Make sure a tab was actually clicked. The arrow buttons
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * mess things up.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tab_clicked = pidgin_conv_get_tab_at_xy(win, e->x_root, e->y_root, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (tab_clicked == -1)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /*
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * Get the relative position of the press event, with regards to
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * the position of the notebook.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gdk_window_get_origin(win->notebook->window, &nb_x, &nb_y);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 x_rel = e->x_root - nb_x;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 y_rel = e->y_root - nb_y;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Reset the min/max x/y */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->drag_min_x = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->drag_min_y = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->drag_max_x = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->drag_max_y = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Find out which tab was dragged. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(win->notebook), tab_clicked);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tab = gtk_notebook_get_tab_label(GTK_NOTEBOOK(win->notebook), page);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->drag_min_x = tab->allocation.x + nb_x;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->drag_min_y = tab->allocation.y + nb_y;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->drag_max_x = tab->allocation.width + win->drag_min_x;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->drag_max_y = tab->allocation.height + win->drag_min_y;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Make sure the click occurred in the tab. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (e->x_root < win->drag_min_x ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 e->x_root >= win->drag_max_x ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 e->y_root < win->drag_min_y ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 e->y_root >= win->drag_max_y) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->in_predrag = TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->drag_tab = tab_clicked;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Connect the new motion signals. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->drag_motion_signal =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(widget), "motion_notify_event",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(notebook_motion_cb), win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->drag_leave_signal =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(widget), "leave_notify_event",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(notebook_leave_cb), win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 notebook_release_cb(GtkWidget *widget, GdkEventButton *e, PidginWindow *win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *dest_win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gint dest_page_num = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean new_window = FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean to_right = FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /*
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * Don't check to make sure that the event's window matches the
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * widget's, because we may be getting an event passed on from the
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * close button.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (e->button != 1 && e->type != GDK_BUTTON_RELEASE)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gdk_pointer_is_grabbed()) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gdk_pointer_ungrab(GDK_CURRENT_TIME);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_grab_remove(widget);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!win->in_predrag && !win->in_drag)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Disconnect the motion signal. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (win->drag_motion_signal) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_handler_disconnect(G_OBJECT(widget),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->drag_motion_signal);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->drag_motion_signal = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /*
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * If we're in a pre-drag, we'll also need to disconnect the leave
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * signal.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (win->in_predrag) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->in_predrag = FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (win->drag_leave_signal) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_handler_disconnect(G_OBJECT(widget),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->drag_leave_signal);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->drag_leave_signal = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* If we're not in drag... */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* We're perfectly normal people! */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!win->in_drag)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->in_drag = FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 dnd_hints_hide_all();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 dest_win = pidgin_conv_window_get_at_xy(e->x_root, e->y_root);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = pidgin_conv_window_get_active_conversation(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (dest_win == NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* If the current window doesn't have any other conversations,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * there isn't much point transferring the conv to a new window. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (pidgin_conv_window_get_gtkconv_count(win) > 1) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Make a new window to stick this to. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 dest_win = pidgin_conv_window_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 new_window = TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (dest_win == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_emit(pidgin_conversations_get_handle(),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "conversation-dragging", win, dest_win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Get the destination page number. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!new_window)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 dest_page_num = pidgin_conv_get_tab_at_xy(dest_win,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 e->x_root, e->y_root, &to_right);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = pidgin_conv_window_get_gtkconv_at_index(win, win->drag_tab);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (win == dest_win) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_reorder_child(GTK_NOTEBOOK(win->notebook), gtkconv->tab_cont, dest_page_num);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_remove_gtkconv(win, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_add_gtkconv(dest_win, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_reorder_child(GTK_NOTEBOOK(dest_win->notebook), gtkconv->tab_cont, dest_page_num + to_right);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_switch_gtkconv(dest_win, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (new_window) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gint win_width, win_height;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_window_get_size(GTK_WINDOW(dest_win->window),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 &win_width, &win_height);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #ifdef WIN32 /* only override window manager placement on Windows */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_window_move(GTK_WINDOW(dest_win->window),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 e->x_root - (win_width / 2),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 e->y_root - (win_height / 2));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_show(dest_win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_grab_focus(PIDGIN_CONVERSATION(conv)->entry);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 before_switch_conv_cb(GtkNotebook *notebook, GtkWidget *page, gint page_num,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gpointer user_data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win = user_data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = pidgin_conv_window_get_active_conversation(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(conv != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv) != PURPLE_CONV_TYPE_IM)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = PIDGIN_CONVERSATION(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->u.im->typing_timer != 0) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_source_remove(gtkconv->u.im->typing_timer);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->u.im->typing_timer = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 stop_anim(NULL, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 close_window(GtkWidget *w, PidginWindow *win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 close_win_cb(w, NULL, win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 detach_tab_cb(GtkWidget *w, GObject *menu)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win, *new_window;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = g_object_get_data(menu, "clicked_tab");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win = pidgin_conv_get_window(gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Nothing to do if there's only one tab in the window */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (pidgin_conv_window_get_gtkconv_count(win) == 1)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_remove_gtkconv(win, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 new_window = pidgin_conv_window_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_add_gtkconv(new_window, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_show(new_window);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 close_others_cb(GtkWidget *w, GObject *menu)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *iter;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = g_object_get_data(menu, "clicked_tab");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win = pidgin_conv_get_window(gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (iter = pidgin_conv_window_get_gtkconvs(win); iter; )
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gconv = iter->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 iter = iter->next;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gconv != gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 close_conv_cb(NULL, NULL, gconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void close_tab_cb(GtkWidget *w, GObject *menu)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = g_object_get_data(menu, "clicked_tab");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 close_conv_cb(NULL, NULL, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 right_click_menu_cb(GtkNotebook *notebook, GdkEventButton *event, PidginWindow *win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *item, *menu;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (event->type != GDK_BUTTON_PRESS || event->button != 3)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = pidgin_conv_window_get_gtkconv_at_index(win,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_get_tab_at_xy(win, event->x_root, event->y_root, NULL));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (g_object_get_data(G_OBJECT(notebook->menu), "clicked_tab"))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set_data(G_OBJECT(notebook->menu), "clicked_tab", gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set_data(G_OBJECT(notebook->menu), "clicked_tab", gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menu = notebook->menu;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_separator(GTK_WIDGET(menu));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 item = gtk_menu_item_new_with_label(_("Close other tabs"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(item);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(item), "activate",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(close_others_cb), menu);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 item = gtk_menu_item_new_with_label(_("Close all tabs"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(item);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(item), "activate",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(close_window), win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_separator(menu);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 item = gtk_menu_item_new_with_label(_("Detach this tab"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(item);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(item), "activate",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(detach_tab_cb), menu);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 item = gtk_menu_item_new_with_label(_("Close this tab"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(item);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(item), "activate",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(close_tab_cb), menu);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 remove_edit_entry(PidginConversation *gtkconv, GtkWidget *entry)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_handlers_disconnect_matched(G_OBJECT(entry), G_SIGNAL_MATCH_DATA,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 0, 0, NULL, NULL, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(gtkconv->infopane);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_grab_focus(gtkconv->entry);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_destroy(entry);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 alias_focus_cb(GtkWidget *widget, GdkEventFocus *event, gpointer user_data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 remove_edit_entry(user_data, widget);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 alias_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer user_data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (event->keyval == GDK_Escape) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 remove_edit_entry(user_data, widget);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 alias_cb(GtkEntry *entry, gpointer user_data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleAccount *account;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *name;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = (PidginConversation *)user_data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv == NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 account = purple_conversation_get_account(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 name = purple_conversation_get_name(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBuddy *buddy;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buddy = purple_find_buddy(account, name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (buddy != NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_blist_alias_buddy(buddy,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_entry_get_text(entry));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 serv_alias_buddy(buddy);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_entry_set_text(GTK_ENTRY(gtkconv->u.chat->topic_text), gtk_entry_get_text(entry));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 topic_callback(NULL, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 remove_edit_entry(user_data, GTK_WIDGET(entry));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 infopane_entry_activate(PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *entry = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *text = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!GTK_WIDGET_VISIBLE(gtkconv->infopane)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* There's already an entry for alias. Let's not create another one. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!purple_account_is_connected(gtkconv->active_conv->account)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Do not allow aliasing someone on a disconnected account. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBuddy *buddy = purple_find_buddy(gtkconv->active_conv->account, gtkconv->active_conv->name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!buddy)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* This buddy isn't in your buddy list, so we can't alias him */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 text = purple_buddy_get_contact_alias(buddy);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConnection *gc;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurplePluginProtocolInfo *prpl_info = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gc = purple_conversation_get_gc(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gc != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (prpl_info && prpl_info->set_chat_topic == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* This protocol doesn't support setting the chat room topic */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 text = purple_conv_chat_get_topic(PURPLE_CONV_CHAT(conv));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* alias label */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 entry = gtk_entry_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_entry_set_has_frame(GTK_ENTRY(entry), FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_entry_set_width_chars(GTK_ENTRY(entry), 10);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #if GTK_CHECK_VERSION(2,4,0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_entry_set_alignment(GTK_ENTRY(entry), 0.5);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(gtkconv->infopane_hbox), entry, TRUE, TRUE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* after the tab label */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_reorder_child(GTK_BOX(gtkconv->infopane_hbox), entry, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(entry), "activate", G_CALLBACK(alias_cb), gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(entry), "focus-out-event", G_CALLBACK(alias_focus_cb), gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(entry), "key-press-event", G_CALLBACK(alias_key_press_cb), gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (text != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_entry_set_text(GTK_ENTRY(entry), text);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(entry);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_hide(gtkconv->infopane);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_grab_focus(entry);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 window_keypress_cb(GtkWidget *widget, GdkEventKey *event, PidginWindow *win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv = pidgin_conv_window_get_active_gtkconv(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return conv_keypress_common(gtkconv, event);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 switch_conv_cb(GtkNotebook *notebook, GtkWidget *page, gint page_num,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gpointer user_data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *sound_method;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win = user_data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = pidgin_conv_window_get_gtkconv_at_index(win, page_num);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(conv != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* clear unseen flag if conversation is not hidden */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(!pidgin_conv_is_hidden(gtkconv)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv_set_unseen(gtkconv, PIDGIN_UNSEEN_NONE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Update the menubar */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtkconv->win->menu.logging),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_is_logging(conv));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 generate_send_to_items(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 regenerate_options_items(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 regenerate_plugins_items(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_switch_active_conversation(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 sound_method = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (strcmp(sound_method, "none") != 0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(win->menu.sounds),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->make_sound);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(win->menu.show_formatting_toolbar),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/show_formatting_toolbar"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(win->menu.show_timestamps),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/show_timestamps"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /*
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * We pause icons when they are not visible. If this icon should
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * be animated then start it back up again.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (gtkconv->u.im->animate))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 start_anim(NULL, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_emit(pidgin_conversations_get_handle(), "conversation-switched", conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /**************************************************************************
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * GTK+ window ops
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 **************************************************************************/
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_windows_get_list()
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return window_list;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GList*
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 make_status_icon_list(const char *stock, GtkWidget *w)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *l = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 l = g_list_append(l, gtk_widget_render_icon (w, stock,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL), "GtkWindow"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 l = g_list_append(l, gtk_widget_render_icon (w, stock,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_SMALL), "GtkWindow"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 l = g_list_append(l, gtk_widget_render_icon (w, stock,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_MEDIUM), "GtkWindow"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 l = g_list_append(l, gtk_widget_render_icon (w, stock,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_LARGE), "GtkWindow"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return l;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 create_icon_lists(GtkWidget *w)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 available_list = make_status_icon_list(PIDGIN_STOCK_STATUS_AVAILABLE, w);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 busy_list = make_status_icon_list(PIDGIN_STOCK_STATUS_BUSY, w);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 xa_list = make_status_icon_list(PIDGIN_STOCK_STATUS_XA, w);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 login_list = make_status_icon_list(PIDGIN_STOCK_STATUS_LOGIN, w);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 logout_list = make_status_icon_list(PIDGIN_STOCK_STATUS_LOGOUT, w);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 offline_list = make_status_icon_list(PIDGIN_STOCK_STATUS_OFFLINE, w);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 away_list = make_status_icon_list(PIDGIN_STOCK_STATUS_AWAY, w);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 prpl_lists = g_hash_table_new(g_str_hash, g_str_equal);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 plugin_changed_cb(PurplePlugin *p, gpointer data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 regenerate_plugins_items(data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean gtk_conv_configure_cb(GtkWidget *w, GdkEventConfigure *event, gpointer data) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int x, y;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (GTK_WIDGET_VISIBLE(w))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_window_get_position(GTK_WINDOW(w), &x, &y);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE; /* carry on normally */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Workaround for GTK+ bug # 169811 - "configure_event" is fired
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * when the window is being maximized */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gdk_window_get_state(w->window) & GDK_WINDOW_STATE_MAXIMIZED)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* don't save off-screen positioning */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (x + event->width < 0 ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 y + event->height < 0 ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 x > gdk_screen_width() ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 y > gdk_screen_height())
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE; /* carry on normally */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* store the position */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/im/x", x);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/im/y", y);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/im/width", event->width);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/im/height", event->height);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* continue to handle event normally */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_set_position_size(PidginWindow *win, int conv_x, int conv_y,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int conv_width, int conv_height)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* if the window exists, is hidden, we're saving positions, and the
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * position is sane... */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (win && win->window &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 !GTK_WIDGET_VISIBLE(win->window) && conv_width != 0) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* ...check position is on screen... */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (conv_x >= gdk_screen_width())
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_x = gdk_screen_width() - 100;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (conv_x + conv_width < 0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_x = 100;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (conv_y >= gdk_screen_height())
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_y = gdk_screen_height() - 100;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (conv_y + conv_height < 0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_y = 100;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* ...and move it back. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_window_move(GTK_WINDOW(win->window), conv_x, conv_y);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_window_resize(GTK_WINDOW(win->window), conv_width, conv_height);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_restore_position(PidginWindow *win) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_set_position_size(win,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/im/x"),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/im/y"),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/im/width"),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/im/height"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_new()
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkPositionType pos;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *testidea;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *menubar;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #if GTK_CHECK_VERSION(2,6,0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkModifierType state;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win = g_malloc0(sizeof(PidginWindow));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 window_list = g_list_append(window_list, win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Create the window. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->window = pidgin_create_window(NULL, 0, "conversation", TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #if GTK_CHECK_VERSION(2,6,0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!gtk_get_current_event_state(&state))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_window_set_focus_on_map(GTK_WINDOW(win->window), FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_restore_position(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (available_list == NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 create_icon_lists(win->window);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(win->window), "delete_event",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(close_win_cb), win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(win->window), "focus_in_event",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(focus_win_cb), win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Intercept keystrokes from the menu items */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(win->window), "key_press_event",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(window_keypress_cb), win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Create the notebook. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->notebook = gtk_notebook_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pos = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/tab_side");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #if 0
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_set_tab_hborder(GTK_NOTEBOOK(win->notebook), 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_set_tab_vborder(GTK_NOTEBOOK(win->notebook), 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(win->notebook), pos);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_set_scrollable(GTK_NOTEBOOK(win->notebook), TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_popup_enable(GTK_NOTEBOOK(win->notebook));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_set_show_tabs(GTK_NOTEBOOK(win->notebook), FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_set_show_border(GTK_NOTEBOOK(win->notebook), TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(win->notebook), "button-press-event",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(right_click_menu_cb), win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(win->notebook);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(win->notebook), "switch_page",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(before_switch_conv_cb), win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect_after(G_OBJECT(win->notebook), "switch_page",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(switch_conv_cb), win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Setup the tab drag and drop signals. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_add_events(win->notebook,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GDK_BUTTON1_MOTION_MASK | GDK_LEAVE_NOTIFY_MASK);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(win->notebook), "button_press_event",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(notebook_press_cb), win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(win->notebook), "button_release_event",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(notebook_release_cb), win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 testidea = gtk_vbox_new(FALSE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Setup the menubar. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 menubar = setup_menubar(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(testidea), menubar, FALSE, TRUE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(testidea), win->notebook, TRUE, TRUE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_container_add(GTK_CONTAINER(win->window), testidea);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(testidea);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Update the plugin actions when plugins are (un)loaded */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_connect(purple_plugins_get_handle(), "plugin-load",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win, PURPLE_CALLBACK(plugin_changed_cb), win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signal_connect(purple_plugins_get_handle(), "plugin-unload",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win, PURPLE_CALLBACK(plugin_changed_cb), win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #ifdef _WIN32
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(win->window), "show",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(winpidgin_ensure_onscreen), win->window);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/win32/minimize_new_convs")
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 && !gtk_get_current_event_state(&state))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_window_iconify(GTK_WINDOW(win->window));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_destroy(PidginWindow *win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_disconnect_by_handle(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 window_list = g_list_remove(window_list, win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Close the "Find" dialog if it's open */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (win->dialogs.search)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_destroy(win->dialogs.search);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (win->gtkconvs) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 while (win->gtkconvs) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean last = (win->gtkconvs->next == NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 close_conv_cb(NULL, NULL, win->gtkconvs->data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (last)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_destroy(win->window);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_unref(G_OBJECT(win->menu.item_factory));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_notify_close_with_handle(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_signals_disconnect_by_handle(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_show(PidginWindow *win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(win->window);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_hide(PidginWindow *win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_hide(win->window);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_raise(PidginWindow *win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gdk_window_raise(GDK_WINDOW(win->window->window));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_switch_gtkconv(PidginWindow *win, PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_set_current_page(GTK_NOTEBOOK(win->notebook),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_page_num(GTK_NOTEBOOK(win->notebook),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->tab_cont));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 close_button_left_cb(GtkWidget *widget, GdkEventCrossing *event, GtkLabel *label)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GdkCursor *ptr = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (ptr == NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ptr = gdk_cursor_new(GDK_LEFT_PTR);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_label_set_markup(label, "�");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gdk_window_set_cursor(event->window, ptr);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 close_button_entered_cb(GtkWidget *widget, GdkEventCrossing *event, GtkLabel *label)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GdkCursor *hand = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (hand == NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 hand = gdk_cursor_new(GDK_HAND2);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_label_set_markup(label, "<u>�</u>");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gdk_window_set_cursor(event->window, hand);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_add_gtkconv(PidginWindow *win, PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *conv = gtkconv->active_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *focus_gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *tab_cont = gtkconv->tab_cont;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *close_image;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversationType conv_type;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const gchar *tmp_lab;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_type = purple_conversation_get_type(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->gtkconvs = g_list_append(win->gtkconvs, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->win = win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (win->gtkconvs && win->gtkconvs->next && win->gtkconvs->next->next == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_tab_pack(win, ((PidginConversation*)win->gtkconvs->data));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Close button. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->close = gtk_event_box_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #if GTK_CHECK_VERSION(2,4,0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_event_box_set_visible_window(GTK_EVENT_BOX(gtkconv->close), FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_events(gtkconv->close, GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 close_image = gtk_label_new("�");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(gtkconv->close), "enter-notify-event", G_CALLBACK(close_button_entered_cb), close_image);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(gtkconv->close), "leave-notify-event", G_CALLBACK(close_button_left_cb), close_image);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(close_image);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_container_add(GTK_CONTAINER(gtkconv->close), close_image);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_tooltips_set_tip(gtkconv->tooltips, gtkconv->close,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 _("Close conversation"), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(gtkconv->close), "button-press-event",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(close_conv_cb), gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #if !GTK_CHECK_VERSION(2,6,0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /*
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * I love Galeon. They have a fix for that stupid annoying visible
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * border bug. I love you guys! -- ChipX86
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* This is fixed properly in some version of Gtk before 2.6.0 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(gtkconv->close), "state_changed",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(tab_close_button_state_changed_cb), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Status icon. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->icon = gtk_image_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->menu_icon = gtk_image_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(gtkconv->icon);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 update_tab_icon(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Tab label. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->tab_label = gtk_label_new(tmp_lab = purple_conversation_get_title(conv));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_name(gtkconv->tab_label, "tab-label");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->menu_tabby = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->menu_label = gtk_label_new(tmp_lab);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(gtkconv->menu_tabby), gtkconv->menu_icon, FALSE, FALSE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show_all(gtkconv->menu_icon);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(gtkconv->menu_tabby), gtkconv->menu_label, TRUE, TRUE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(gtkconv->menu_label);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_misc_set_alignment(GTK_MISC(gtkconv->menu_label), 0, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(gtkconv->menu_tabby);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_update_buddy_icon(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Build and set conversations tab */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_tab_pack(win, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_set_menu_label(GTK_NOTEBOOK(win->notebook), tab_cont, gtkconv->menu_tabby);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(tab_cont);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (pidgin_conv_window_get_gtkconv_count(win) == 1) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Er, bug in notebooks? Switch to the page manually. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_set_current_page(GTK_NOTEBOOK(win->notebook), 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_set_show_tabs(GTK_NOTEBOOK(win->notebook), TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 focus_gtkconv = g_list_nth_data(pidgin_conv_window_get_gtkconvs(win),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_get_current_page(GTK_NOTEBOOK(win->notebook)));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_grab_focus(focus_gtkconv->entry);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (pidgin_conv_window_get_gtkconv_count(win) == 1)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 update_send_to_selection(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_tab_pack(PidginWindow *win, PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean tabs_side = FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gint angle = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *first, *third, *ebox;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/tab_side") == GTK_POS_LEFT ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/tab_side") == GTK_POS_RIGHT)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tabs_side = TRUE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/tab_side") == (GTK_POS_LEFT|8))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 angle = 90;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if (purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/tab_side") == (GTK_POS_RIGHT|8))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 angle = 270;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #if GTK_CHECK_VERSION(2,6,0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!angle) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set(G_OBJECT(gtkconv->tab_label), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_label_set_width_chars(GTK_LABEL(gtkconv->tab_label), 4);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_set(G_OBJECT(gtkconv->tab_label), "ellipsize", PANGO_ELLIPSIZE_NONE, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_label_set_width_chars(GTK_LABEL(gtkconv->tab_label), -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (tabs_side) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_label_set_width_chars(
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_LABEL(gtkconv->tab_label),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 MIN(g_utf8_strlen(gtk_label_get_text(GTK_LABEL(gtkconv->tab_label)), -1), 12)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 );
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_label_set_angle(GTK_LABEL(gtkconv->tab_label), angle);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #if 0
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_misc_set_alignment(GTK_MISC(gtkconv->tab_label), 0.00, 0.5);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_misc_set_padding(GTK_MISC(gtkconv->tab_label), 4, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (angle)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->tabby = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv->tabby = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_set_name(gtkconv->tabby, "tab-container");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* select the correct ordering for verticle tabs */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (angle == 90) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 first = gtkconv->close;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 third = gtkconv->icon;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 first = gtkconv->icon;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 third = gtkconv->close;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ebox = gtk_event_box_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #if GTK_CHECK_VERSION(2,4,0)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_event_box_set_visible_window(GTK_EVENT_BOX(ebox), FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_container_add(GTK_CONTAINER(ebox), gtkconv->tabby);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gtkconv->tab_label->parent == NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Pack if it's a new widget */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(gtkconv->tabby), first, FALSE, FALSE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(gtkconv->tabby), gtkconv->tab_label, TRUE, TRUE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(gtkconv->tabby), third, FALSE, FALSE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Add this pane to the conversation's notebook. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_append_page(GTK_NOTEBOOK(win->notebook), gtkconv->tab_cont, ebox);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* reparent old widgets on preference changes */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_reparent(first, gtkconv->tabby);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_reparent(gtkconv->tab_label, gtkconv->tabby);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_reparent(third, gtkconv->tabby);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_set_child_packing(GTK_BOX(gtkconv->tabby), first, FALSE, FALSE, 0, GTK_PACK_START);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_set_child_packing(GTK_BOX(gtkconv->tabby), gtkconv->tab_label, TRUE, TRUE, 0, GTK_PACK_START);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_set_child_packing(GTK_BOX(gtkconv->tabby), third, FALSE, FALSE, 0, GTK_PACK_START);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Reset the tabs label to the new version */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_set_tab_label(GTK_NOTEBOOK(win->notebook), gtkconv->tab_cont, ebox);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_set_tab_label_packing(GTK_NOTEBOOK(win->notebook), gtkconv->tab_cont,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 !tabs_side && !angle,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 TRUE, GTK_PACK_START);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (pidgin_conv_window_get_gtkconv_count(win) == 1)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_set_show_tabs(GTK_NOTEBOOK(win->notebook),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/tabs") &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/im/show_buddy_icons") ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/tab_side") != GTK_POS_TOP));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* show the widgets */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* gtk_widget_show(gtkconv->icon); */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(gtkconv->tab_label);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/close_on_tabs"))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(gtkconv->close);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(gtkconv->tabby);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(ebox);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_remove_gtkconv(PidginWindow *win, PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 unsigned int index;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversationType conv_type;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_type = purple_conversation_get_type(gtkconv->active_conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 index = gtk_notebook_page_num(GTK_NOTEBOOK(win->notebook), gtkconv->tab_cont);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_ref(gtkconv->tab_cont);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_object_sink(GTK_OBJECT(gtkconv->tab_cont));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_notebook_remove_page(GTK_NOTEBOOK(win->notebook), index);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->gtkconvs = g_list_remove(win->gtkconvs, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_handlers_disconnect_matched(win->window, G_SIGNAL_MATCH_DATA,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 0, 0, NULL, NULL, gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (win->gtkconvs && win->gtkconvs->next == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_tab_pack(win, win->gtkconvs->data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!win->gtkconvs && win != hidden_convwin)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_destroy(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_get_gtkconv_at_index(const PidginWindow *win, int index)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *tab_cont;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (index == -1)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 index = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tab_cont = gtk_notebook_get_nth_page(GTK_NOTEBOOK(win->notebook), index);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return tab_cont ? g_object_get_data(G_OBJECT(tab_cont), "PidginConversation") : NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_get_active_gtkconv(const PidginWindow *win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int index;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *tab_cont;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 index = gtk_notebook_get_current_page(GTK_NOTEBOOK(win->notebook));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (index == -1)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 index = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tab_cont = gtk_notebook_get_nth_page(GTK_NOTEBOOK(win->notebook), index);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!tab_cont)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return g_object_get_data(G_OBJECT(tab_cont), "PidginConversation");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversation *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_get_active_conversation(const PidginWindow *win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *gtkconv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtkconv = pidgin_conv_window_get_active_gtkconv(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return gtkconv ? gtkconv->active_conv : NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_is_active_conversation(const PurpleConversation *conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return conv == pidgin_conv_window_get_active_conversation(PIDGIN_CONVERSATION(conv)->win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_has_focus(PidginWindow *win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean has_focus = FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_object_get(G_OBJECT(win->window), "has-toplevel-focus", &has_focus, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return has_focus;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_get_at_xy(int x, int y)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkWindow *gdkwin;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *l;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gdkwin = gdk_window_at_pointer(&x, &y);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gdkwin)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gdkwin = gdk_window_get_toplevel(gdkwin);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (l = pidgin_conv_windows_get_list(); l != NULL; l = l->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win = l->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gdkwin == win->window->window)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_get_gtkconvs(PidginWindow *win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return win->gtkconvs;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 guint
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_get_gtkconv_count(PidginWindow *win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return g_list_length(win->gtkconvs);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_first_with_type(PurpleConversationType type)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *wins, *convs;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (type == PURPLE_CONV_TYPE_UNKNOWN)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (wins = pidgin_conv_windows_get_list(); wins != NULL; wins = wins->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win = wins->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (convs = win->gtkconvs;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 convs != NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 convs = convs->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = convs->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv->active_conv) == type)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_last_with_type(PurpleConversationType type)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *wins, *convs;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (type == PURPLE_CONV_TYPE_UNKNOWN)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (wins = g_list_last(pidgin_conv_windows_get_list());
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 wins != NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 wins = wins->prev) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win = wins->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (convs = win->gtkconvs;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 convs != NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 convs = convs->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv = convs->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv->active_conv) == type)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /**************************************************************************
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * Conversation placement functions
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 **************************************************************************/
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 typedef struct
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *id;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *name;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConvPlacementFunc fnc;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } ConvPlacementData;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GList *conv_placement_fncs = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static PidginConvPlacementFunc place_conv = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* This one places conversations in the last made window. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_placement_last_created_win(PidginConversation *conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *l = g_list_last(pidgin_conv_windows_get_list());
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win = l ? l->data : NULL;;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (win == NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win = pidgin_conv_window_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(win->window), "configure_event",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(gtk_conv_configure_cb), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_add_gtkconv(win, conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_show(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_add_gtkconv(win, conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* This one places conversations in the last made window of the same type. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_placement_last_created_win_type_configured_cb(GtkWidget *w,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkEventConfigure *event, PidginConversation *conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int x, y;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversationType type = purple_conversation_get_type(conv->active_conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *all;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (GTK_WIDGET_VISIBLE(w))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_window_get_position(GTK_WINDOW(w), &x, &y);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE; /* carry on normally */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Workaround for GTK+ bug # 169811 - "configure_event" is fired
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * when the window is being maximized */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gdk_window_get_state(w->window) & GDK_WINDOW_STATE_MAXIMIZED)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* don't save off-screen positioning */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (x + event->width < 0 ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 y + event->height < 0 ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 x > gdk_screen_width() ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 y > gdk_screen_height())
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE; /* carry on normally */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (all = conv->convs; all != NULL; all = all->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (type != purple_conversation_get_type(all->data)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* this window has different types of conversation, don't save */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (type == PURPLE_CONV_TYPE_IM) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/im/x", x);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/im/y", y);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/im/width", event->width);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/im/height", event->height);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (type == PURPLE_CONV_TYPE_CHAT) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/chat/x", x);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/chat/y", y);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/chat/width", event->width);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/chat/height", event->height);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_placement_last_created_win_type(PidginConversation *conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win = pidgin_conv_window_last_with_type(purple_conversation_get_type(conv->active_conv));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (win == NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win = pidgin_conv_window_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (PURPLE_CONV_TYPE_IM == purple_conversation_get_type(conv->active_conv) ||
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/chat/width") == 0) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_set_position_size(win,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/im/x"),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/im/y"),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/im/width"),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/im/height"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (PURPLE_CONV_TYPE_CHAT == purple_conversation_get_type(conv->active_conv)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_set_position_size(win,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/chat/x"),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/chat/y"),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/chat/width"),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/chat/height"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_add_gtkconv(win, conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_show(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(win->window), "configure_event",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(conv_placement_last_created_win_type_configured_cb), conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_add_gtkconv(win, conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* This one places each conversation in its own window. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_placement_new_window(PidginConversation *conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win = pidgin_conv_window_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(win->window), "configure_event",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(gtk_conv_configure_cb), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_add_gtkconv(win, conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_show(win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static PurpleGroup *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_get_group(PidginConversation *conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleGroup *group = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_conversation_get_type(conv->active_conv) == PURPLE_CONV_TYPE_IM) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleBuddy *buddy;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 buddy = purple_find_buddy(purple_conversation_get_account(conv->active_conv),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_get_name(conv->active_conv));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (buddy != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 group = purple_buddy_get_group(buddy);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } else if (purple_conversation_get_type(conv->active_conv) == PURPLE_CONV_TYPE_CHAT) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleChat *chat;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 chat = purple_blist_find_chat(purple_conversation_get_account(conv->active_conv),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_conversation_get_name(conv->active_conv));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (chat != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 group = purple_chat_get_group(chat);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return group;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /*
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * This groups things by, well, group. Buddies from groups will always be
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * grouped together, and a buddy from a group not belonging to any currently
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * open windows will get a new window.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_placement_by_group(PidginConversation *conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversationType type;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleGroup *group = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *wl, *cl;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 type = purple_conversation_get_type(conv->active_conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 group = conv_get_group(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Go through the list of IMs and find one with this group. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (wl = pidgin_conv_windows_get_list(); wl != NULL; wl = wl->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win2;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *conv2;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleGroup *group2 = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win2 = wl->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (cl = win2->gtkconvs;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 cl != NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 cl = cl->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv2 = cl->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 group2 = conv_get_group(conv2);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (group == group2) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_add_gtkconv(win2, conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Make a new window. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_placement_new_window(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* This groups things by account. Otherwise, the same semantics as above */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_placement_by_account(PidginConversation *conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleConversationType type;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *wins, *convs;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PurpleAccount *account;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 account = purple_conversation_get_account(conv->active_conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 type = purple_conversation_get_type(conv->active_conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Go through the list of IMs and find one with this group. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (wins = pidgin_conv_windows_get_list(); wins != NULL; wins = wins->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginWindow *win2;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConversation *conv2;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win2 = wins->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (convs = win2->gtkconvs;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 convs != NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 convs = convs->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv2 = convs->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (account == purple_conversation_get_account(conv2->active_conv)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_window_add_gtkconv(win2, conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Make a new window. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_placement_new_window(conv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static ConvPlacementData *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 get_conv_placement_data(const char *id)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ConvPlacementData *data = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *n;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (n = conv_placement_fncs; n; n = n->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 data = n->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!strcmp(data->id, id))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 add_conv_placement_fnc(const char *id, const char *name,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConvPlacementFunc fnc)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ConvPlacementData *data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 data = g_new(ConvPlacementData, 1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 data->id = g_strdup(id);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 data->name = g_strdup(name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 data->fnc = fnc;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_placement_fncs = g_list_append(conv_placement_fncs, data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ensure_default_funcs(void)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (conv_placement_fncs == NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 add_conv_placement_fnc("last", _("Last created window"),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_placement_last_created_win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 add_conv_placement_fnc("im_chat", _("Separate IM and Chat windows"),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_placement_last_created_win_type);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 add_conv_placement_fnc("new", _("New window"),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_placement_new_window);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 add_conv_placement_fnc("group", _("By group"),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_placement_by_group);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 add_conv_placement_fnc("account", _("By account"),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_placement_by_account);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_placement_get_options(void)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GList *n, *list = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ConvPlacementData *data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ensure_default_funcs();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 for (n = conv_placement_fncs; n; n = n->next) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 data = n->data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 list = g_list_append(list, data->name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 list = g_list_append(list, data->id);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return list;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_placement_add_fnc(const char *id, const char *name,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConvPlacementFunc fnc)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(id != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(name != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(fnc != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ensure_default_funcs();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 add_conv_placement_fnc(id, name, fnc);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_placement_remove_fnc(const char *id)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ConvPlacementData *data = get_conv_placement_data(id);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (data == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_placement_fncs = g_list_remove(conv_placement_fncs, data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(data->id);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(data->name);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(data);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_placement_get_name(const char *id)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ConvPlacementData *data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ensure_default_funcs();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 data = get_conv_placement_data(id);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (data == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return data->name;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConvPlacementFunc
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_placement_get_fnc(const char *id)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ConvPlacementData *data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ensure_default_funcs();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 data = get_conv_placement_data(id);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (data == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return data->fnc;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_placement_set_current_func(PidginConvPlacementFunc func)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_if_fail(func != NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* If tabs are enabled, set the function, otherwise, NULL it out. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/tabs"))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 place_conv = func;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 place_conv = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 PidginConvPlacementFunc
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_placement_get_current_func(void)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return place_conv;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_placement_place(PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (place_conv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 place_conv(gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 conv_placement_new_window(gtkconv);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pidgin_conv_is_hidden(PidginConversation *gtkconv)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_return_val_if_fail(gtkconv != NULL, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return (gtkconv->win == hidden_convwin);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Algorithm from http://www.w3.org/TR/AERT#color-contrast */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 color_is_visible(GdkColor foreground, GdkColor background, int color_contrast, int brightness_contrast)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gulong fg_brightness;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gulong bg_brightness;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gulong br_diff;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gulong col_diff;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int fred, fgreen, fblue, bred, bgreen, bblue;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* this algorithm expects colors between 0 and 255 for each of red green and blue.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * GTK on the other hand has values between 0 and 65535
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * Err suggested I >> 8, which grabbed the high bits.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 fred = foreground.red >> 8 ;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 fgreen = foreground.green >> 8 ;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 fblue = foreground.blue >> 8 ;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 bred = background.red >> 8 ;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 bgreen = background.green >> 8 ;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 bblue = background.blue >> 8 ;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 fg_brightness = (fred * 299 + fgreen * 587 + fblue * 114) / 1000;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 bg_brightness = (bred * 299 + bgreen * 587 + bblue * 114) / 1000;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 br_diff = abs(fg_brightness - bg_brightness);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 col_diff = abs(fred - bred) + abs(fgreen - bgreen) + abs(fblue - bblue);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return ((col_diff > color_contrast) && (br_diff > brightness_contrast));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GdkColor*
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 generate_nick_colors(guint *color_count, GdkColor background)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 guint numcolors = *color_count;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 guint i = 0, j = 0;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkColor *colors = g_new(GdkColor, numcolors);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkColor nick_highlight;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkColor send_color;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 time_t breakout_time;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gdk_color_parse(DEFAULT_HIGHLIGHT_COLOR, &nick_highlight);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gdk_color_parse(DEFAULT_SEND_COLOR, &send_color);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 srand(background.red + background.green + background.blue + 1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 breakout_time = time(NULL) + 3;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* first we look through the list of "good" colors: colors that differ from every other color in the
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * list. only some of them will differ from the background color though. lets see if we can find
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * numcolors of them that do
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 while (i < numcolors && j < NUM_NICK_SEED_COLORS && time(NULL) < breakout_time)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkColor color = nick_seed_colors[j];
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (color_is_visible(color, background, MIN_COLOR_CONTRAST, MIN_BRIGHTNESS_CONTRAST) &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 color_is_visible(color, nick_highlight, MIN_COLOR_CONTRAST / 2, 0) &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 color_is_visible(color, send_color, MIN_COLOR_CONTRAST / 4, 0))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 colors[i] = color;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 i++;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 j++;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* we might not have found numcolors in the last loop. if we did, we'll never enter this one.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * if we did not, lets just find some colors that don't conflict with the background. its
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * expensive to find colors that not only don't conflict with the background, but also do not
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * conflict with each other.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 while(i < numcolors && time(NULL) < breakout_time)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkColor color = { 0, rand() % 65536, rand() % 65536, rand() % 65536 };
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (color_is_visible(color, background, MIN_COLOR_CONTRAST, MIN_BRIGHTNESS_CONTRAST) &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 color_is_visible(color, nick_highlight, MIN_COLOR_CONTRAST / 2, 0) &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 color_is_visible(color, send_color, MIN_COLOR_CONTRAST / 4, 0))
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 colors[i] = color;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 i++;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (i < numcolors) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GdkColor *c = colors;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 purple_debug_warning("gtkconv", "Unable to generate enough random colors before timeout. %u colors found.\n", i);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 colors = g_memdup(c, i * sizeof(GdkColor));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(c);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 *color_count = i;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return colors;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }