comparison src/server.c @ 834:bac7089491c1

[gaim-migrate @ 844] redesigned chat page a bit, and fixed some libfaim stuff. oh, and made some FIXME's more informative. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sat, 02 Sep 2000 12:46:05 +0000
parents 97f1ae636ed7
children 38ffd1faa31a
comparison
equal deleted inserted replaced
833:8d8ef8c3afe2 834:bac7089491c1
35 #include "gaim.h" 35 #include "gaim.h"
36 36
37 static int idle_timer = -1; 37 static int idle_timer = -1;
38 static time_t lastsent = 0; 38 static time_t lastsent = 0;
39 static time_t login_time = 0; 39 static time_t login_time = 0;
40 static struct timeval lag_tv;
41 static int is_idle = 0; 40 static int is_idle = 0;
42 41
43 int correction_time = 0; 42 int correction_time = 0;
44 43
45 int serv_login(char *username, char *password) 44 int serv_login(char *username, char *password)
82 time_t t; 81 time_t t;
83 82
84 /* Not idle, really... :) */ 83 /* Not idle, really... :) */
85 update_all_buddies(); 84 update_all_buddies();
86 85
86 plugin_event(event_blist_update, 0, 0, 0);
87
87 time(&t); 88 time(&t);
88
89 gettimeofday(&lag_tv, NULL);
90 89
91 if (report_idle != IDLE_GAIM) 90 if (report_idle != IDLE_GAIM)
92 return TRUE; 91 return TRUE;
93 92
94 93
98 if ((t - lastsent) > 600) { /* 15 minutes! */ 97 if ((t - lastsent) > 600) { /* 15 minutes! */
99 serv_set_idle((int)t - lastsent); 98 serv_set_idle((int)t - lastsent);
100 is_idle = 1; 99 is_idle = 1;
101 } 100 }
102 101
103 plugin_event(event_blist_update, 0, 0, 0);
104
105 return TRUE; 102 return TRUE;
106 103
107 } 104 }
108 105
109 106
141 void serv_send_im(char *name, char *message, int away) 138 void serv_send_im(char *name, char *message, int away)
142 { 139 {
143 struct conversation *cnv = find_conversation(name); 140 struct conversation *cnv = find_conversation(name);
144 if (cnv && cnv->is_direct) { 141 if (cnv && cnv->is_direct) {
145 if (!USE_OSCAR) { 142 if (!USE_OSCAR) {
146 /* FIXME */ 143 /* Direct IM TOC FIXME */
147 } else { 144 } else {
148 sprintf(debug_buff, "Sending DirectIM to %s\n", name); 145 sprintf(debug_buff, "Sending DirectIM to %s\n", name);
149 debug_print(debug_buff); 146 debug_print(debug_buff);
150 aim_send_im_direct(gaim_sess, cnv->conn, message); 147 aim_send_im_direct(gaim_sess, cnv->conn, message);
151 } 148 }
262 char *buf = g_malloc(BUF_LONG); 259 char *buf = g_malloc(BUF_LONG);
263 g_snprintf(buf, BUF_LONG, "toc_change_passwd %s %s", orig, new); 260 g_snprintf(buf, BUF_LONG, "toc_change_passwd %s %s", orig, new);
264 sflap_send(buf, strlen(buf), TYPE_DATA); 261 sflap_send(buf, strlen(buf), TYPE_DATA);
265 g_free(buf); 262 g_free(buf);
266 } else { 263 } else {
267 /* FIXME */ 264 /* Oscar change_passwd FIXME */
268 } 265 }
269 } 266 }
270 267
271 void serv_add_buddy(char *name) 268 void serv_add_buddy(char *name)
272 { 269 {
563 560
564 c = find_oscar_chat(b->name); 561 c = find_oscar_chat(b->name);
565 if (c != NULL) { 562 if (c != NULL) {
566 oscar_chats = g_list_remove(oscar_chats, c); 563 oscar_chats = g_list_remove(oscar_chats, c);
567 gdk_input_remove(c->inpa); 564 gdk_input_remove(c->inpa);
568 aim_conn_kill(gaim_sess, &c->conn); 565 if (gaim_sess)
566 aim_conn_kill(gaim_sess, &c->conn);
569 g_free(c->name); 567 g_free(c->name);
570 g_free(c); 568 g_free(c);
571 } 569 }
572 /* we do this because with Oscar it doesn't tell us we left */ 570 /* we do this because with Oscar it doesn't tell us we left */
573 serv_got_chat_left(b->id); 571 serv_got_chat_left(b->id);
1013 void serv_do_imimage(GtkWidget *w, char *name) { 1011 void serv_do_imimage(GtkWidget *w, char *name) {
1014 struct conversation *cnv = find_conversation(name); 1012 struct conversation *cnv = find_conversation(name);
1015 if (!cnv) cnv = new_conversation(name); 1013 if (!cnv) cnv = new_conversation(name);
1016 1014
1017 if (!USE_OSCAR) { 1015 if (!USE_OSCAR) {
1018 /* FIXME */ 1016 /* Direct IM TOC FIXME */
1019 } else { 1017 } else {
1020 oscar_do_directim(name); 1018 oscar_do_directim(name);
1021 } 1019 }
1022 } 1020 }
1023 1021
1024 void serv_got_imimage(char *name, char *cookie, char *ip, struct aim_conn_t *conn, int watcher) 1022 void serv_got_imimage(char *name, char *cookie, char *ip, struct aim_conn_t *conn, int watcher)
1025 { 1023 {
1026 if (!USE_OSCAR) { 1024 if (!USE_OSCAR) {
1027 /* FIXME */ 1025 /* Direct IM TOC FIXME */
1028 } else { 1026 } else {
1029 struct conversation *cnv = find_conversation(name); 1027 struct conversation *cnv = find_conversation(name);
1030 if (!cnv) cnv = new_conversation(name); 1028 if (!cnv) cnv = new_conversation(name);
1031 make_direct(cnv, TRUE, conn, watcher); 1029 make_direct(cnv, TRUE, conn, watcher);
1032 } 1030 }