pidgin  2.13.0
About: Pidgin is a chat program (multi-protocol instant messaging client) which lets you log in to accounts on multiple chat networks simultaneously (old name "gaim").
  Fossies Dox: pidgin-2.13.0.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

gntconv.c File Reference
#include <internal.h>
#include "finch.h"
#include <cmds.h>
#include <core.h>
#include <idle.h>
#include <prefs.h>
#include <util.h>
#include "gntaccount.h"
#include "gntblist.h"
#include "gntconv.h"
#include "gntdebug.h"
#include "gntlog.h"
#include "gntplugin.h"
#include "gntpounce.h"
#include "gntprefs.h"
#include "gntrequest.h"
#include "gntsound.h"
#include "gntstatus.h"
#include "gnt.h"
#include "gntbox.h"
#include "gntentry.h"
#include "gntlabel.h"
#include "gntmenu.h"
#include "gntmenuitem.h"
#include "gntmenuitemcheck.h"
#include "gntstyle.h"
#include "gnttextview.h"
#include "gnttree.h"
#include "gntutils.h"
#include "gntwindow.h"
#include "config.h"
Include dependency graph for gntconv.c:

Go to the source code of this file.

Macros

#define PREF_ROOT   "/finch/conversations"
 
#define PREF_CHAT   PREF_ROOT "/chats"
 
#define PREF_USERLIST   PREF_CHAT "/userlist"
 

Functions

static void finch_write_common (PurpleConversation *conv, const char *who, const char *message, PurpleMessageFlags flags, time_t mtime)
 
static void generate_send_to_menu (FinchConv *ggc)
 
static PurpleBuddyfind_buddy_for_conversation (PurpleConversation *conv)
 
static PurpleChatfind_chat_for_conversation (PurpleConversation *conv)
 
static PurpleBlistNodeget_conversation_blist_node (PurpleConversation *conv)
 
static void send_typing_notification (GntWidget *w, FinchConv *ggconv)
 
static void entry_key_pressed (GntWidget *w, FinchConv *ggconv)
 
static void closing_window (GntWidget *window, FinchConv *ggconv)
 
static void size_changed_cb (GntWidget *widget, int width, int height)
 
static void save_position_cb (GntWidget *w, int x, int y)
 
static PurpleConversationfind_conv_with_contact (PurpleAccount *account, const char *name)
 
static char * get_conversation_title (PurpleConversation *conv, PurpleAccount *account)
 
static void update_buddy_typing (PurpleAccount *account, const char *who, gpointer null)
 
static void chat_left_cb (PurpleConversation *conv, gpointer null)
 
static void buddy_signed_on_off (PurpleBuddy *buddy, gpointer null)
 
static void account_signed_on_off (PurpleConnection *gc, gpointer null)
 
static void account_signing_off (PurpleConnection *gc)
 
static gpointer finch_conv_get_handle (void)
 
static void cleared_message_history_cb (PurpleConversation *conv, gpointer data)
 
static void clear_scrollback_cb (GntMenuItem *item, gpointer ggconv)
 
static void send_file_cb (GntMenuItem *item, gpointer ggconv)
 
static void add_pounce_cb (GntMenuItem *item, gpointer ggconv)
 
static void get_info_cb (GntMenuItem *item, gpointer ggconv)
 
static void toggle_timestamps_cb (GntMenuItem *item, gpointer ggconv)
 
static void toggle_logging_cb (GntMenuItem *item, gpointer ggconv)
 
static void toggle_sound_cb (GntMenuItem *item, gpointer ggconv)
 
static void send_to_cb (GntMenuItem *m, gpointer n)
 
static void view_log_cb (GntMenuItem *n, gpointer ggc)
 
static void invite_cb (GntMenuItem *item, gpointer ggconv)
 
static void gg_create_menu (FinchConv *ggc)
 
static void create_conv_from_userlist (GntWidget *widget, FinchConv *fc)
 
static void gained_focus_cb (GntWindow *window, FinchConv *fc)
 
static void completion_cb (GntEntry *entry, const char *start, const char *end)
 
static void gg_setup_commands (FinchConv *fconv, gboolean remove_first)
 
static void cmd_added_cb (const char *cmd, PurpleCmdPriority prior, PurpleCmdFlag flags, FinchConv *fconv)
 
static void cmd_removed_cb (const char *cmd, FinchConv *fconv)
 
static void finch_create_conversation (PurpleConversation *conv)
 
static void finch_destroy_conversation (PurpleConversation *conv)
 
static void finch_write_chat (PurpleConversation *conv, const char *who, const char *message, PurpleMessageFlags flags, time_t mtime)
 
static void finch_write_im (PurpleConversation *conv, const char *who, const char *message, PurpleMessageFlags flags, time_t mtime)
 
static void finch_write_conv (PurpleConversation *conv, const char *who, const char *alias, const char *message, PurpleMessageFlags flags, time_t mtime)
 
static const char * chat_flag_text (PurpleConvChatBuddyFlags flags)
 
static void finch_chat_add_users (PurpleConversation *conv, GList *users, gboolean new_arrivals)
 
static void finch_chat_rename_user (PurpleConversation *conv, const char *old, const char *new_n, const char *new_a)
 
static void finch_chat_remove_users (PurpleConversation *conv, GList *list)
 
static void finch_chat_update_user (PurpleConversation *conv, const char *user)
 
static void finch_conv_present (PurpleConversation *conv)
 
static gboolean finch_conv_has_focus (PurpleConversation *conv)
 
PurpleConversationUiOpsfinch_conv_get_ui_ops ()
 
static PurpleCmdRet say_command_cb (PurpleConversation *conv, const char *cmd, char **args, char **error, void *data)
 
static PurpleCmdRet me_command_cb (PurpleConversation *conv, const char *cmd, char **args, char **error, void *data)
 
static PurpleCmdRet debug_command_cb (PurpleConversation *conv, const char *cmd, char **args, char **error, void *data)
 
static PurpleCmdRet clear_command_cb (PurpleConversation *conv, const char *cmd, char **args, char **error, void *data)
 
static PurpleCmdRet help_command_cb (PurpleConversation *conv, const char *cmd, char **args, char **error, void *data)
 
static PurpleCmdRet cmd_show_window (PurpleConversation *conv, const char *cmd, char **args, char **error, gpointer data)
 
static PurpleCmdRet cmd_message_color (PurpleConversation *conv, const char *cmd, char **args, char **error, gpointer data)
 
static PurpleCmdRet users_command_cb (PurpleConversation *conv, const char *cmd, char **args, char **error, gpointer data)
 
void finch_conversation_init ()
 
void finch_conversation_uninit ()
 
void finch_conversation_set_active (PurpleConversation *conv)
 
void finch_conversation_set_info_widget (PurpleConversation *conv, GntWidget *widget)
 

Variables

static int color_message_receive
 
static int color_message_send
 
static int color_message_highlight
 
static int color_message_action
 
static int color_timestamp
 
static PurpleConversationUiOps conv_ui_ops
 

Detailed Description

GNT Conversation API

Definition in file gntconv.c.

Macro Definition Documentation

◆ PREF_CHAT

#define PREF_CHAT   PREF_ROOT "/chats"

Definition at line 62 of file gntconv.c.

◆ PREF_ROOT

#define PREF_ROOT   "/finch/conversations"

Definition at line 61 of file gntconv.c.

◆ PREF_USERLIST

#define PREF_USERLIST   PREF_CHAT "/userlist"

Definition at line 63 of file gntconv.c.

Function Documentation

◆ account_signed_on_off()

◆ account_signing_off()

◆ add_pounce_cb()

static void add_pounce_cb ( GntMenuItem item,
gpointer  ggconv 
)
static

◆ buddy_signed_on_off()

static void buddy_signed_on_off ( PurpleBuddy buddy,
gpointer  null 
)
static

◆ chat_flag_text()

◆ chat_left_cb()

static void chat_left_cb ( PurpleConversation conv,
gpointer  null 
)
static

Definition at line 312 of file gntconv.c.

References _(), finch_write_common(), NULL, PURPLE_MESSAGE_SYSTEM, and time().

Referenced by finch_conversation_init().

◆ clear_command_cb()

static PurpleCmdRet clear_command_cb ( PurpleConversation conv,
const char *  cmd,
char **  args,
char **  error,
void *  data 
)
static

Definition at line 1272 of file gntconv.c.

References PURPLE_CMD_RET_OK, and purple_conversation_clear_message_history().

Referenced by finch_conversation_init().

◆ clear_scrollback_cb()

static void clear_scrollback_cb ( GntMenuItem item,
gpointer  ggconv 
)
static

Definition at line 407 of file gntconv.c.

References _FinchConv::active_conv, and purple_conversation_clear_message_history().

Referenced by gg_create_menu().

◆ cleared_message_history_cb()

static void cleared_message_history_cb ( PurpleConversation conv,
gpointer  data 
)
static

Definition at line 399 of file gntconv.c.

References FINCH_GET_DATA, GNT_TEXT_VIEW, gnt_text_view_clear(), and _FinchConv::tv.

Referenced by finch_conversation_init().

◆ closing_window()

static void closing_window ( GntWidget window,
FinchConv ggconv 
)
static

◆ cmd_added_cb()

static void cmd_added_cb ( const char *  cmd,
PurpleCmdPriority  prior,
PurpleCmdFlag  flags,
FinchConv fconv 
)
static

Definition at line 734 of file gntconv.c.

References gg_setup_commands(), and TRUE.

Referenced by finch_create_conversation().

◆ cmd_message_color()

static PurpleCmdRet cmd_message_color ( PurpleConversation conv,
const char *  cmd,
char **  args,
char **  error,
gpointer  data 
)
static

◆ cmd_removed_cb()

static void cmd_removed_cb ( const char *  cmd,
FinchConv fconv 
)
static

◆ cmd_show_window()

static PurpleCmdRet cmd_show_window ( PurpleConversation conv,
const char *  cmd,
char **  args,
char **  error,
gpointer  data 
)
static

Definition at line 1320 of file gntconv.c.

References data, and PURPLE_CMD_RET_OK.

Referenced by finch_conversation_init().

◆ completion_cb()

static void completion_cb ( GntEntry entry,
const char *  start,
const char *  end 
)
static

Definition at line 706 of file gntconv.c.

References GNT_WIDGET, gnt_widget_key_pressed(), and _GntEntry::start.

Referenced by finch_create_conversation().

◆ create_conv_from_userlist()

◆ debug_command_cb()

◆ entry_key_pressed()

◆ finch_chat_add_users()

◆ finch_chat_remove_users()

static void finch_chat_remove_users ( PurpleConversation conv,
GList *  list 
)
static

◆ finch_chat_rename_user()

◆ finch_chat_update_user()

◆ finch_conv_get_handle()

static gpointer finch_conv_get_handle ( void  )
static

Definition at line 392 of file gntconv.c.

References handle.

Referenced by finch_conversation_init(), and finch_conversation_uninit().

◆ finch_conv_get_ui_ops()

PurpleConversationUiOps* finch_conv_get_ui_ops ( void  )

Get the ui-functions.

Returns
The PurpleConversationUiOps populated with the appropriate functions.

Definition at line 1189 of file gntconv.c.

References conv_ui_ops.

Referenced by gnt_ui_init().

◆ finch_conv_has_focus()

static gboolean finch_conv_has_focus ( PurpleConversation conv)
static

Definition at line 1158 of file gntconv.c.

References FALSE, FINCH_CONV, gnt_widget_has_focus(), and _FinchConv::window.

◆ finch_conv_present()

static void finch_conv_present ( PurpleConversation conv)
static

Definition at line 1150 of file gntconv.c.

References FINCH_CONV, gnt_window_present(), and _FinchConv::window.

◆ finch_conversation_init()

◆ finch_conversation_set_active()

void finch_conversation_set_active ( PurpleConversation conv)

Set a conversation as active in a contactized conversation

Parameters
convThe conversation to make active.

Definition at line 1495 of file gntconv.c.

References account, _FinchConv::active_conv, FINCH_GET_DATA, get_conversation_title(), gg_setup_commands(), gnt_screen_rename_widget(), _FinchConv::list, purple_conversation_get_account(), TRUE, and _FinchConv::window.

Referenced by finch_create_conversation(), finch_write_common(), selection_activate(), and send_to_cb().

◆ finch_conversation_set_info_widget()

void finch_conversation_set_info_widget ( PurpleConversation conv,
GntWidget widget 
)

Sets the information widget for the conversation window.

Parameters
convThe conversation.
widgetThe widget containing the information. If NULL, the current information widget is removed.

Definition at line 1514 of file gntconv.c.

References _FinchConv::entry, FINCH_GET_DATA, GNT_BOX, gnt_box_add_widget(), gnt_box_give_focus_to_child(), gnt_box_readjust(), gnt_box_remove_all(), gnt_screen_resize_widget(), gnt_widget_get_size(), _FinchConv::info, widget, and _FinchConv::window.

◆ finch_conversation_uninit()

void finch_conversation_uninit ( void  )

Perform the necessary uninitializations.

Definition at line 1490 of file gntconv.c.

References finch_conv_get_handle(), and purple_signals_disconnect_by_handle().

◆ finch_create_conversation()

static void finch_create_conversation ( PurpleConversation conv)
static

Definition at line 750 of file gntconv.c.

References account, _FinchConv::active_conv, _FinchConv::chat, closing_window(), cmd_added_cb(), cmd_removed_cb(), completion_cb(), create_conv_from_userlist(), _FinchConv::entry, entry_key_pressed(), FALSE, FINCH_CONV_NO_SOUND, finch_conversation_set_active(), FINCH_GET_DATA, FINCH_SET_DATA, finch_sound_is_enabled(), find_conv_with_contact(), _FinchConv::flags, gained_focus_cb(), get_conversation_blist_node(), get_conversation_title(), gg_create_menu(), gg_setup_commands(), GNT_BOX, gnt_box_add_widget(), gnt_box_give_focus_to_child(), gnt_box_set_pad(), gnt_box_set_title(), gnt_box_set_toplevel(), GNT_ENTRY, gnt_entry_new(), gnt_entry_set_always_suggest(), gnt_entry_set_history_length(), gnt_entry_set_word_suggest(), gnt_hbox_new, GNT_TEXT_VIEW, gnt_text_view_attach_pager_widget(), gnt_text_view_attach_scroll_widget(), gnt_text_view_new(), GNT_TREE, gnt_tree_new_with_columns(), gnt_tree_set_col_width(), gnt_tree_set_compare_func(), gnt_tree_set_hash_fns(), gnt_tree_set_search_column(), gnt_vbox_new, gnt_vwindow_new, GNT_WIDGET_NO_BORDER, GNT_WIDGET_SET_FLAGS, gnt_widget_set_name(), gnt_widget_set_position(), gnt_widget_set_size(), gnt_widget_set_visible(), gnt_widget_show(), gnt_window_present(), _FinchConv::im, _FinchConv::info, _FinchConv::list, NULL, PREF_ROOT, PREF_USERLIST, purple_blist_node_get_bool(), purple_cmds_get_handle(), PURPLE_CONV_TYPE_ANY, PURPLE_CONV_TYPE_CHAT, PURPLE_CONV_TYPE_IM, PURPLE_CONV_TYPE_MISC, PURPLE_CONV_TYPE_UNKNOWN, purple_conversation_get_account(), purple_conversation_get_name(), purple_conversation_get_type(), purple_conversation_is_logging(), purple_conversation_set_logging(), purple_prefs_get_bool(), purple_prefs_get_int(), purple_signal_connect(), save_position_cb(), send_typing_notification(), size_changed_cb(), tree, TRUE, _FinchConv::tv, dbus-analyze-signals::type, _FinchConv::u, _FinchConvChat::userlist, and _FinchConv::window.

◆ finch_destroy_conversation()

◆ finch_write_chat()

static void finch_write_chat ( PurpleConversation conv,
const char *  who,
const char *  message,
PurpleMessageFlags  flags,
time_t  mtime 
)
static

Definition at line 1009 of file gntconv.c.

References flags, mtime, and purple_conversation_write().

◆ finch_write_common()

◆ finch_write_conv()

static void finch_write_conv ( PurpleConversation conv,
const char *  who,
const char *  alias,
const char *  message,
PurpleMessageFlags  flags,
time_t  mtime 
)
static

Definition at line 1041 of file gntconv.c.

References finch_write_common(), flags, mtime, name, and NULL.

◆ finch_write_im()

◆ find_buddy_for_conversation()

static PurpleBuddy* find_buddy_for_conversation ( PurpleConversation conv)
static

◆ find_chat_for_conversation()

static PurpleChat* find_chat_for_conversation ( PurpleConversation conv)
static

◆ find_conv_with_contact()

◆ gained_focus_cb()

static void gained_focus_cb ( GntWindow window,
FinchConv fc 
)
static

◆ generate_send_to_menu()

◆ get_conversation_blist_node()

◆ get_conversation_title()

static char* get_conversation_title ( PurpleConversation conv,
PurpleAccount account 
)
static

◆ get_info_cb()

static void get_info_cb ( GntMenuItem item,
gpointer  ggconv 
)
static

◆ gg_create_menu()

◆ gg_setup_commands()

◆ help_command_cb()

static PurpleCmdRet help_command_cb ( PurpleConversation conv,
const char *  cmd,
char **  args,
char **  error,
void *  data 
)
static

◆ invite_cb()

static void invite_cb ( GntMenuItem item,
gpointer  ggconv 
)
static

Definition at line 590 of file gntconv.c.

References _FinchConv::active_conv, NULL, PURPLE_CONV_CHAT(), purple_conv_chat_invite_user(), and TRUE.

Referenced by gg_create_menu().

◆ me_command_cb()

static PurpleCmdRet me_command_cb ( PurpleConversation conv,
const char *  cmd,
char **  args,
char **  error,
void *  data 
)
static

◆ save_position_cb()

static void save_position_cb ( GntWidget w,
int  x,
int  y 
)
static

Definition at line 237 of file gntconv.c.

References PREF_ROOT, and purple_prefs_set_int().

Referenced by finch_create_conversation().

◆ say_command_cb()

static PurpleCmdRet say_command_cb ( PurpleConversation conv,
const char *  cmd,
char **  args,
char **  error,
void *  data 
)
static

◆ send_file_cb()

static void send_file_cb ( GntMenuItem item,
gpointer  ggconv 
)
static

◆ send_to_cb()

static void send_to_cb ( GntMenuItem m,
gpointer  n 
)
static

◆ send_typing_notification()

◆ size_changed_cb()

static void size_changed_cb ( GntWidget widget,
int  width,
int  height 
)
static

Definition at line 228 of file gntconv.c.

References gnt_widget_get_size(), PREF_ROOT, purple_prefs_set_int(), and widget.

Referenced by finch_create_conversation().

◆ toggle_logging_cb()

◆ toggle_sound_cb()

static void toggle_sound_cb ( GntMenuItem item,
gpointer  ggconv 
)
static

◆ toggle_timestamps_cb()

static void toggle_timestamps_cb ( GntMenuItem item,
gpointer  ggconv 
)
static

Definition at line 439 of file gntconv.c.

References PREF_ROOT, purple_prefs_get_bool(), and purple_prefs_set_bool().

Referenced by gg_create_menu().

◆ update_buddy_typing()

◆ users_command_cb()

◆ view_log_cb()

Variable Documentation

◆ color_message_action

int color_message_action
static

Definition at line 74 of file gntconv.c.

Referenced by cmd_message_color(), finch_conversation_init(), and finch_write_common().

◆ color_message_highlight

int color_message_highlight
static

Definition at line 73 of file gntconv.c.

Referenced by cmd_message_color(), finch_conversation_init(), and finch_write_common().

◆ color_message_receive

int color_message_receive
static

Definition at line 71 of file gntconv.c.

Referenced by cmd_message_color(), finch_conversation_init(), and finch_write_common().

◆ color_message_send

int color_message_send
static

Definition at line 72 of file gntconv.c.

Referenced by cmd_message_color(), finch_conversation_init(), and finch_write_common().

◆ color_timestamp

int color_timestamp
static

Definition at line 75 of file gntconv.c.

Referenced by cmd_message_color(), finch_conversation_init(), and finch_write_common().

◆ conv_ui_ops

finch_chat_add_users
static void finch_chat_add_users(PurpleConversation *conv, GList *users, gboolean new_arrivals)
Definition: gntconv.c:1070
finch_write_chat
static void finch_write_chat(PurpleConversation *conv, const char *who, const char *message, PurpleMessageFlags flags, time_t mtime)
Definition: gntconv.c:1009
NULL
#define NULL
Definition: getopt1.c:52
finch_write_conv
static void finch_write_conv(PurpleConversation *conv, const char *who, const char *alias, const char *message, PurpleMessageFlags flags, time_t mtime)
Definition: gntconv.c:1041
finch_chat_remove_users
static void finch_chat_remove_users(PurpleConversation *conv, GList *list)
Definition: gntconv.c:1129
finch_create_conversation
static void finch_create_conversation(PurpleConversation *conv)
Definition: gntconv.c:750
finch_conv_has_focus
static gboolean finch_conv_has_focus(PurpleConversation *conv)
Definition: gntconv.c:1158
finch_destroy_conversation
static void finch_destroy_conversation(PurpleConversation *conv)
Definition: gntconv.c:885
finch_chat_update_user
static void finch_chat_update_user(PurpleConversation *conv, const char *user)
Definition: gntconv.c:1142
finch_write_im
static void finch_write_im(PurpleConversation *conv, const char *who, const char *message, PurpleMessageFlags flags, time_t mtime)
Definition: gntconv.c:1016
finch_chat_rename_user
static void finch_chat_rename_user(PurpleConversation *conv, const char *old, const char *new_n, const char *new_a)
Definition: gntconv.c:1111
finch_conv_present
static void finch_conv_present(PurpleConversation *conv)
Definition: gntconv.c:1150