comparison console/gntconv.c @ 14008:d9fab56e6011

[gaim-migrate @ 16594] Enhancement patch from wabz (Richard Nelson) to show the title of the conversation, and to show the alias of the buddy in the conversation if set. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 29 Jul 2006 09:39:43 +0000
parents 4d5cc9e4cb12
children 7573bd40a190
comparison
equal deleted inserted replaced
14007:9653b21bde9e 14008:d9fab56e6011
160 160
161 ggc->conv = conv; 161 ggc->conv = conv;
162 conv->ui_data = ggc; 162 conv->ui_data = ggc;
163 163
164 type = gaim_conversation_get_type(conv); 164 type = gaim_conversation_get_type(conv);
165 title = g_strdup_printf(_("%s"), gaim_conversation_get_name(conv)); 165 title = g_strdup_printf(_("%s"), gaim_conversation_get_title(conv));
166 ggc->window = gnt_box_new(FALSE, TRUE); 166 ggc->window = gnt_box_new(FALSE, TRUE);
167 gnt_box_set_title(GNT_BOX(ggc->window), title); 167 gnt_box_set_title(GNT_BOX(ggc->window), title);
168 gnt_box_set_toplevel(GNT_BOX(ggc->window), TRUE); 168 gnt_box_set_toplevel(GNT_BOX(ggc->window), TRUE);
169 gnt_box_set_pad(GNT_BOX(ggc->window), 0); 169 gnt_box_set_pad(GNT_BOX(ggc->window), 0);
170 gnt_widget_set_name(ggc->window, title); 170 gnt_widget_set_name(ggc->window, title);
242 242
243 static void 243 static void
244 gg_write_im(GaimConversation *conv, const char *who, const char *message, 244 gg_write_im(GaimConversation *conv, const char *who, const char *message,
245 GaimMessageFlags flags, time_t mtime) 245 GaimMessageFlags flags, time_t mtime)
246 { 246 {
247 GaimAccount *account = gaim_conversation_get_account(conv);
247 if (flags & GAIM_MESSAGE_SEND) 248 if (flags & GAIM_MESSAGE_SEND)
248 { 249 {
249 GaimAccount *account = gaim_conversation_get_account(conv);
250 who = gaim_connection_get_display_name(gaim_account_get_connection(account)); 250 who = gaim_connection_get_display_name(gaim_account_get_connection(account));
251 if (!who) 251 if (!who)
252 who = gaim_account_get_alias(account); 252 who = gaim_account_get_alias(account);
253 if (!who) 253 if (!who)
254 who = gaim_account_get_username(account); 254 who = gaim_account_get_username(account);
255 } 255 }
256 else if (flags & GAIM_MESSAGE_RECV) 256 else if (flags & GAIM_MESSAGE_RECV)
257 {
258 GaimBuddy *buddy;
257 who = gaim_conversation_get_name(conv); 259 who = gaim_conversation_get_name(conv);
260 buddy = gaim_find_buddy(account, who);
261 if (buddy)
262 who = gaim_buddy_get_contact_alias(buddy);
263 }
258 264
259 gg_write_common(conv, who, message, flags, mtime); 265 gg_write_common(conv, who, message, flags, mtime);
260 } 266 }
261 267
262 static void 268 static void