comparison src/buddy_chat.c @ 2289:38e156136896

[gaim-migrate @ 2299] some irc fixes committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Mon, 17 Sep 2001 05:00:56 +0000
parents a9787aad60f3
children bd9d403fb15b
comparison
equal deleted inserted replaced
2288:b41c88001ab5 2289:38e156136896
105 105
106 static void rebuild_jc() 106 static void rebuild_jc()
107 { 107 {
108 GList *list, *tmp; 108 GList *list, *tmp;
109 struct proto_chat_entry *pce; 109 struct proto_chat_entry *pce;
110 gboolean focus = TRUE;
110 111
111 if (!joinchatgc) 112 if (!joinchatgc)
112 return; 113 return;
113 114
114 while (GTK_BOX(jc_vbox)->children) 115 while (GTK_BOX(jc_vbox)->children)
147 entry = gtk_entry_new(); 148 entry = gtk_entry_new();
148 chatentries = g_list_append(chatentries, entry); 149 chatentries = g_list_append(chatentries, entry);
149 gtk_box_pack_start(GTK_BOX(rowbox), entry, TRUE, TRUE, 0); 150 gtk_box_pack_start(GTK_BOX(rowbox), entry, TRUE, TRUE, 0);
150 if (pce->def) 151 if (pce->def)
151 gtk_entry_set_text(GTK_ENTRY(entry), pce->def); 152 gtk_entry_set_text(GTK_ENTRY(entry), pce->def);
152 gtk_widget_grab_focus(entry); 153 if (focus) {
154 gtk_widget_grab_focus(entry);
155 focus = FALSE;
156 }
153 gtk_signal_connect(GTK_OBJECT(entry), "activate", 157 gtk_signal_connect(GTK_OBJECT(entry), "activate",
154 GTK_SIGNAL_FUNC(do_join_chat), NULL); 158 GTK_SIGNAL_FUNC(do_join_chat), NULL);
155 gtk_widget_show(entry); 159 gtk_widget_show(entry);
156 } 160 }
157 161
485 489
486 490
487 if (!(flag & WFLAG_WHISPER)) { 491 if (!(flag & WFLAG_WHISPER)) {
488 str = g_strdup(normalize(who)); 492 str = g_strdup(normalize(who));
489 if (!g_strcasecmp(str, normalize(b->gc->username))) { 493 if (!g_strcasecmp(str, normalize(b->gc->username))) {
490 debug_printf("%s %s\n", normalize(who), normalize(b->gc->username)); 494 if (b->makesound && (sound_options & OPT_SOUND_CHAT_YOU_SAY))
495 play_sound(CHAT_YOU_SAY);
496 flag |= WFLAG_SEND;
497 } else if (!g_strcasecmp(str, normalize(b->gc->displayname))) {
491 if (b->makesound && (sound_options & OPT_SOUND_CHAT_YOU_SAY)) 498 if (b->makesound && (sound_options & OPT_SOUND_CHAT_YOU_SAY))
492 play_sound(CHAT_YOU_SAY); 499 play_sound(CHAT_YOU_SAY);
493 flag |= WFLAG_SEND; 500 flag |= WFLAG_SEND;
494 } else { 501 } else {
495 if (b->makesound && (sound_options & OPT_SOUND_CHAT_SAY)) 502 if (b->makesound && (sound_options & OPT_SOUND_CHAT_SAY))
536 chat_write(b, buf2, WFLAG_WHISPER, buf, time((time_t)NULL)); 543 chat_write(b, buf2, WFLAG_WHISPER, buf, time((time_t)NULL));
537 544
538 gtk_widget_grab_focus(GTK_WIDGET(b->entry)); 545 gtk_widget_grab_focus(GTK_WIDGET(b->entry));
539 546
540 547
541 }
542
543 void topic_callback(GtkWidget *widget, struct conversation *b) {
544 char *buf = gtk_entry_get_text(GTK_ENTRY(widget));;
545
546 serv_chat_set_topic(b->gc, b->id, buf);
547
548 g_free(buf);
549 } 548 }
550 549
551 static gint insertname(gconstpointer one, gconstpointer two) 550 static gint insertname(gconstpointer one, gconstpointer two)
552 { 551 {
553 const char *a = (const char *)one; 552 const char *a = (const char *)one;
966 label = gtk_label_new(_("Topic:")); 965 label = gtk_label_new(_("Topic:"));
967 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); 966 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
968 gtk_widget_show(label); 967 gtk_widget_show(label);
969 968
970 b->topic_text = gtk_entry_new(); 969 b->topic_text = gtk_entry_new();
971 gtk_signal_connect(GTK_OBJECT(b->topic_text), "activate", 970 gtk_entry_set_editable(GTK_ENTRY(b->topic_text), FALSE);
972 GTK_SIGNAL_FUNC(topic_callback), b);
973 gtk_box_pack_start(GTK_BOX(hbox), b->topic_text, TRUE, TRUE, 5); 971 gtk_box_pack_start(GTK_BOX(hbox), b->topic_text, TRUE, TRUE, 5);
974 gtk_widget_show(b->topic_text); 972 gtk_widget_show(b->topic_text);
975 } 973 }
976 974
977 vpaned = gtk_vpaned_new(); 975 vpaned = gtk_vpaned_new();