Mercurial > pidgin.yaz
comparison src/server.c @ 2381:427ccd7dfdd2
[gaim-migrate @ 2394]
server.c: 30 / 935 3 %
committer: Tailor Script <tailor@pidgin.im>
| author | Eric Warmenhoven <eric@warmenhoven.org> |
|---|---|
| date | Fri, 28 Sep 2001 05:17:16 +0000 |
| parents | 2927c2c26fe6 |
| children | 569ae9f2bb89 |
comparison
equal
deleted
inserted
replaced
| 2380:6f83c22d9e70 | 2381:427ccd7dfdd2 |
|---|---|
| 29 #include <sys/types.h> | 29 #include <sys/types.h> |
| 30 #include <sys/stat.h> | 30 #include <sys/stat.h> |
| 31 #include <sys/time.h> | 31 #include <sys/time.h> |
| 32 #include <unistd.h> | 32 #include <unistd.h> |
| 33 #include <errno.h> | 33 #include <errno.h> |
| 34 #include <gtk/gtk.h> | |
| 35 #ifdef USE_SCREENSAVER | |
| 36 #include <X11/Xlib.h> | |
| 37 #include <X11/Xutil.h> | |
| 38 #include <X11/extensions/scrnsaver.h> | |
| 39 #endif /* USE_SCREENSAVER */ | |
| 40 extern int gaim_caps; | |
| 41 #include "prpl.h" | 34 #include "prpl.h" |
| 42 #include "multi.h" | 35 #include "multi.h" |
| 43 #include "gaim.h" | 36 #include "gaim.h" |
| 44 | 37 |
| 45 #include "pixmaps/ok.xpm" | 38 #include "pixmaps/ok.xpm" |
| 105 } | 98 } |
| 106 | 99 |
| 107 if (gc->idle_timer > 0) | 100 if (gc->idle_timer > 0) |
| 108 g_source_remove(gc->idle_timer); | 101 g_source_remove(gc->idle_timer); |
| 109 | 102 |
| 110 gc->idle_timer = g_timeout_add(20000, (GtkFunction)check_idle, gc); | 103 gc->idle_timer = g_timeout_add(20000, check_idle, gc); |
| 111 serv_touch_idle(gc); | 104 serv_touch_idle(gc); |
| 112 | 105 |
| 113 time(&gc->login_time); | 106 time(&gc->login_time); |
| 114 | 107 |
| 115 if (gc->prpl->options & OPT_PROTO_CORRECT_TIME) | 108 if (gc->prpl->options & OPT_PROTO_CORRECT_TIME) |
| 654 g_free(who); | 647 g_free(who); |
| 655 who = g_strdup(b->name); | 648 who = g_strdup(b->name); |
| 656 g_snprintf(b->name, sizeof(b->name), "%s", name); | 649 g_snprintf(b->name, sizeof(b->name), "%s", name); |
| 657 handle_buddy_rename(b, who); | 650 handle_buddy_rename(b, who); |
| 658 g_free(who); | 651 g_free(who); |
| 659 /*gtk_label_set_text(GTK_LABEL(b->label), b->name); */ | |
| 660 | 652 |
| 661 /* okay lets save the new config... */ | 653 /* okay lets save the new config... */ |
| 662 | 654 |
| 663 } | 655 } |
| 664 | 656 |
| 706 } | 698 } |
| 707 | 699 |
| 708 set_buddy(gc, b); | 700 set_buddy(gc, b); |
| 709 } | 701 } |
| 710 | 702 |
| 711 static | |
| 712 void close_warned(GtkWidget *w, GtkWidget *w2) | |
| 713 { | |
| 714 gtk_widget_destroy(w2); | |
| 715 } | |
| 716 | |
| 717 | |
| 718 | 703 |
| 719 void serv_got_eviled(struct gaim_connection *gc, char *name, int lev) | 704 void serv_got_eviled(struct gaim_connection *gc, char *name, int lev) |
| 720 { | 705 { |
| 721 char buf2[1024]; | 706 char buf2[1024]; |
| 722 GtkWidget *d, *label, *close; | |
| 723 | 707 |
| 724 plugin_event(event_warned, gc, name, (void *)lev, 0); | 708 plugin_event(event_warned, gc, name, (void *)lev, 0); |
| 725 | 709 |
| 726 if (gc->evil > lev) { | 710 if (gc->evil > lev) { |
| 727 gc->evil = lev; | 711 gc->evil = lev; |
| 731 gc->evil = lev; | 715 gc->evil = lev; |
| 732 | 716 |
| 733 g_snprintf(buf2, sizeof(buf2), "%s has just been warned by %s.\nYour new warning level is %d%%", | 717 g_snprintf(buf2, sizeof(buf2), "%s has just been warned by %s.\nYour new warning level is %d%%", |
| 734 gc->username, ((name == NULL)? "an anonymous person" : name), lev); | 718 gc->username, ((name == NULL)? "an anonymous person" : name), lev); |
| 735 | 719 |
| 736 d = gtk_dialog_new(); | 720 do_error_dialog(_("Warned"), buf2); |
| 737 gtk_widget_realize(d); | |
| 738 aol_icon(d->window); | |
| 739 | |
| 740 label = gtk_label_new(buf2); | |
| 741 gtk_widget_show(label); | |
| 742 close = picture_button(d, _("Close"), cancel_xpm); | |
| 743 gtk_widget_show(close); | |
| 744 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(d)->vbox), label, FALSE, FALSE, 5); | |
| 745 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(d)->action_area), close, FALSE, FALSE, 5); | |
| 746 | |
| 747 gtk_window_set_title(GTK_WINDOW(d), "Warned"); | |
| 748 gtk_signal_connect(GTK_OBJECT(close), "clicked", GTK_SIGNAL_FUNC(close_warned), d); | |
| 749 gtk_widget_show(d); | |
| 750 } | 721 } |
| 751 | 722 |
| 752 | 723 |
| 753 | 724 |
| 754 static void close_invite(GtkWidget *w, GtkWidget *w2) | 725 static void close_invite(GtkWidget *w, GtkWidget *w2) |
| 953 | 924 |
| 954 void update_keepalive(struct gaim_connection *gc, gboolean on) | 925 void update_keepalive(struct gaim_connection *gc, gboolean on) |
| 955 { | 926 { |
| 956 if (on && !gc->keepalive && blist) { | 927 if (on && !gc->keepalive && blist) { |
| 957 debug_printf("allowing NOP\n"); | 928 debug_printf("allowing NOP\n"); |
| 958 gc->keepalive = g_timeout_add(60000, (GtkFunction)send_keepalive, gc); | 929 gc->keepalive = g_timeout_add(60000, send_keepalive, gc); |
| 959 } else if (!on && gc->keepalive > 0) { | 930 } else if (!on && gc->keepalive > 0) { |
| 960 debug_printf("removing NOP\n"); | 931 debug_printf("removing NOP\n"); |
| 961 g_source_remove(gc->keepalive); | 932 g_source_remove(gc->keepalive); |
| 962 gc->keepalive = 0; | 933 gc->keepalive = 0; |
| 963 } | 934 } |
