comparison src/toc.c @ 1118:e1078ee286ba

[gaim-migrate @ 1128] don't send the config on signoff, because we may be signing off because the connection died, in which case sendig the config would cause a SIGPIPE and gaim would exit (it happened to me). committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 21 Nov 2000 10:13:39 +0000
parents c61f9c384413
children 028295b1f1b3
comparison
equal deleted inserted replaced
1117:f3e0f41beddb 1118:e1078ee286ba
45 #include "pixmaps/aol_icon.xpm" 45 #include "pixmaps/aol_icon.xpm"
46 #include "pixmaps/away_icon.xpm" 46 #include "pixmaps/away_icon.xpm"
47 #include "pixmaps/dt_icon.xpm" 47 #include "pixmaps/dt_icon.xpm"
48 #include "pixmaps/free_icon.xpm" 48 #include "pixmaps/free_icon.xpm"
49 49
50 #define REVISION "gaim:$Revision: 1124 $" 50 #define REVISION "gaim:$Revision: 1128 $"
51 51
52 #define TYPE_SIGNON 1 52 #define TYPE_SIGNON 1
53 #define TYPE_DATA 2 53 #define TYPE_DATA 2
54 #define TYPE_ERROR 3 54 #define TYPE_ERROR 3
55 #define TYPE_SIGNOFF 4 55 #define TYPE_SIGNOFF 4
97 #define USEROPT_SOCKSPORT 3 97 #define USEROPT_SOCKSPORT 3
98 #define USEROPT_PROXYTYPE 4 98 #define USEROPT_PROXYTYPE 4
99 99
100 static void toc_callback(gpointer, gint, GdkInputCondition); 100 static void toc_callback(gpointer, gint, GdkInputCondition);
101 static unsigned char *roast_password(char *); 101 static unsigned char *roast_password(char *);
102 int sflap_send(struct gaim_connection *, char *, int, int);
103 102
104 /* ok. this function used to take username/password, and return 0 on success. 103 /* ok. this function used to take username/password, and return 0 on success.
105 * now, it takes username/password, and returns NULL on error or a new gaim_connection 104 * now, it takes username/password, and returns NULL on error or a new gaim_connection
106 * on success. */ 105 * on success. */
107 static void toc_login(struct aim_user *user) { 106 static void toc_login(struct aim_user *user) {
151 150
152 g_snprintf(buf, sizeof(buf), "Signon: %s", gc->username); 151 g_snprintf(buf, sizeof(buf), "Signon: %s", gc->username);
153 set_login_progress(gc, 2, buf); 152 set_login_progress(gc, 2, buf);
154 } 153 }
155 154
156 static void toc_set_config(struct gaim_connection *gc) {
157 char buf[MSG_LEN], snd[MSG_LEN];
158 toc_build_config(gc, buf, MSG_LEN, FALSE);
159 g_snprintf(snd, MSG_LEN, "toc_set_config \"%s\"", buf);
160 sflap_send(gc, snd, -1, TYPE_DATA);
161 }
162
163 static void toc_close(struct gaim_connection *gc) { 155 static void toc_close(struct gaim_connection *gc) {
164 toc_set_config(gc);
165 if (gc->inpa > 0) 156 if (gc->inpa > 0)
166 gdk_input_remove(gc->inpa); 157 gdk_input_remove(gc->inpa);
167 gc->inpa = -1; 158 gc->inpa = -1;
168 close(((struct toc_data *)gc->proto_data)->toc_fd); 159 close(((struct toc_data *)gc->proto_data)->toc_fd);
169 } 160 }
759 g_snprintf(buf, MSG_LEN - 8, "toc_send_im %s \"%s\"%s", normalize(name), 750 g_snprintf(buf, MSG_LEN - 8, "toc_send_im %s \"%s\"%s", normalize(name),
760 message, ((away) ? " auto" : "")); 751 message, ((away) ? " auto" : ""));
761 sflap_send(gc, buf, -1, TYPE_DATA); 752 sflap_send(gc, buf, -1, TYPE_DATA);
762 } 753 }
763 754
755 static void toc_set_config(struct gaim_connection *gc) {
756 char buf[MSG_LEN], snd[MSG_LEN];
757 toc_build_config(gc, buf, MSG_LEN, FALSE);
758 g_snprintf(snd, MSG_LEN, "toc_set_config \"%s\"", buf);
759 sflap_send(gc, snd, -1, TYPE_DATA);
760 }
761
764 static void toc_get_info(struct gaim_connection *g, char *name) { 762 static void toc_get_info(struct gaim_connection *g, char *name) {
765 char buf[MSG_LEN]; 763 char buf[MSG_LEN];
766 g_snprintf(buf, MSG_LEN, "toc_get_info %s", normalize(name)); 764 g_snprintf(buf, MSG_LEN, "toc_get_info %s", normalize(name));
767 sflap_send(g, buf, -1, TYPE_DATA); 765 sflap_send(g, buf, -1, TYPE_DATA);
768 } 766 }