comparison src/buddy.c @ 1299:18c3874ea051

[gaim-migrate @ 1309] sounds only once, auto login hides main window committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 19 Dec 2000 00:43:39 +0000
parents aa6a0fe8e03f
children 035945fca2d5
comparison
equal deleted inserted replaced
1298:38f8096975ef 1299:18c3874ea051
1571 struct buddy_show *b = g_new0(struct buddy_show, 1); 1571 struct buddy_show *b = g_new0(struct buddy_show, 1);
1572 GtkWidget *box; 1572 GtkWidget *box;
1573 GdkPixmap *pm; 1573 GdkPixmap *pm;
1574 GdkBitmap *bm; 1574 GdkBitmap *bm;
1575 int pos = buddy_number(gs->name, buddy->name); 1575 int pos = buddy_number(gs->name, buddy->name);
1576 b->sound = 0;
1576 1577
1577 b->name = g_strdup(buddy->name); 1578 b->name = g_strdup(buddy->name);
1578 b->show = g_strdup(buddy->show); 1579 b->show = g_strdup(buddy->show);
1579 1580
1580 b->item = gtk_tree_item_new(); 1581 b->item = gtk_tree_item_new();
1687 BuddyTickerSetPixmap(b->name, pm, bm); 1688 BuddyTickerSetPixmap(b->name, pm, bm);
1688 gdk_pixmap_unref(pm); 1689 gdk_pixmap_unref(pm);
1689 gdk_bitmap_unref(bm); 1690 gdk_bitmap_unref(bm);
1690 gtk_timeout_remove(b->log_timer); 1691 gtk_timeout_remove(b->log_timer);
1691 b->log_timer = 0; 1692 b->log_timer = 0;
1693 b->sound = 0;
1692 } 1694 }
1693 return 0; 1695 return 0;
1694 } 1696 }
1695 1697
1696 static char *caps_string(gushort caps) 1698 static char *caps_string(gushort caps)
1839 if ((bs = find_buddy_show(gs, b->name)) == NULL) 1841 if ((bs = find_buddy_show(gs, b->name)) == NULL)
1840 bs = new_buddy_show(gs, b, (char **)login_icon_xpm); 1842 bs = new_buddy_show(gs, b, (char **)login_icon_xpm);
1841 if (!g_slist_find(bs->connlist, gc)) 1843 if (!g_slist_find(bs->connlist, gc))
1842 bs->connlist = g_slist_append(bs->connlist, gc); 1844 bs->connlist = g_slist_append(bs->connlist, gc);
1843 if (b->present == 1) { 1845 if (b->present == 1) {
1844 play_sound(BUDDY_ARRIVE); 1846 if (bs->sound != 2)
1847 play_sound(BUDDY_ARRIVE);
1848 bs->sound = 2;
1845 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, 1849 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
1846 NULL, (char **)login_icon_xpm); 1850 NULL, (char **)login_icon_xpm);
1847 gtk_widget_hide(bs->pix); 1851 gtk_widget_hide(bs->pix);
1848 gtk_pixmap_set(GTK_PIXMAP(bs->pix), pm, bm); 1852 gtk_pixmap_set(GTK_PIXMAP(bs->pix), pm, bm);
1849 gtk_widget_show(bs->pix); 1853 gtk_widget_show(bs->pix);
1889 bs = find_buddy_show(gs, b->name); 1893 bs = find_buddy_show(gs, b->name);
1890 if (!bs) return; 1894 if (!bs) return;
1891 if (!bs->connlist) return; /* we won't do signoff updates for 1895 if (!bs->connlist) return; /* we won't do signoff updates for
1892 buddies that have already signed 1896 buddies that have already signed
1893 off */ 1897 off */
1894 play_sound(BUDDY_LEAVE); 1898 if (bs->sound != 1)
1899 play_sound(BUDDY_LEAVE);
1900 bs->sound = 1;
1895 1901
1896 bs->connlist = g_slist_remove(bs->connlist, gc); 1902 bs->connlist = g_slist_remove(bs->connlist, gc);
1897 if (bs->log_timer > 0) 1903 if (bs->log_timer > 0)
1898 gtk_timeout_remove(bs->log_timer); 1904 gtk_timeout_remove(bs->log_timer);
1899 bs->log_timer = gtk_timeout_add(10000, (GtkFunction)log_timeout, bs); 1905 bs->log_timer = gtk_timeout_add(10000, (GtkFunction)log_timeout, bs);