comparison src/toc.c @ 746:5a908dd5cfc4

[gaim-migrate @ 756] i finally got pissed off enough at gnome_applet_mgr.c that i redid it committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 23 Aug 2000 04:14:47 +0000
parents efd72a117875
children 9389216aae29
comparison
equal deleted inserted replaced
745:d693b83e4933 746:5a908dd5cfc4
67 67
68 sin = (struct in_addr *)get_address(aim_host); 68 sin = (struct in_addr *)get_address(aim_host);
69 if (!sin) { 69 if (!sin) {
70 70
71 #ifdef USE_APPLET 71 #ifdef USE_APPLET
72 setUserState(offline); 72 set_user_state(offline);
73 #endif /* USE_APPLET */ 73 #endif /* USE_APPLET */
74 set_state(STATE_OFFLINE); 74 set_state(STATE_OFFLINE);
75 g_snprintf(buf, sizeof(buf), "Unable to lookup %s", aim_host); 75 g_snprintf(buf, sizeof(buf), "Unable to lookup %s", aim_host);
76 hide_login_progress(buf); 76 hide_login_progress(buf);
77 return -1; 77 return -1;
86 86
87 toc_fd = connect_address(sin->s_addr, aim_port); 87 toc_fd = connect_address(sin->s_addr, aim_port);
88 88
89 if (toc_fd < 0) { 89 if (toc_fd < 0) {
90 #ifdef USE_APPLET 90 #ifdef USE_APPLET
91 setUserState(offline); 91 set_user_state(offline);
92 #endif /* USE_APPLET */ 92 #endif /* USE_APPLET */
93 set_state(STATE_OFFLINE); 93 set_state(STATE_OFFLINE);
94 g_snprintf(buf, sizeof(buf), "Connect to %s failed", 94 g_snprintf(buf, sizeof(buf), "Connect to %s failed",
95 inet_ntoa(*sin)); 95 inet_ntoa(*sin));
96 hide_login_progress(buf); 96 hide_login_progress(buf);
103 103
104 set_login_progress(3, buf); 104 set_login_progress(3, buf);
105 105
106 if (toc_signon(username, password) < 0) { 106 if (toc_signon(username, password) < 0) {
107 #ifdef USE_APPLET 107 #ifdef USE_APPLET
108 setUserState(offline); 108 set_user_state(offline);
109 #endif /* USE_APPLET */ 109 #endif /* USE_APPLET */
110 set_state(STATE_OFFLINE); 110 set_state(STATE_OFFLINE);
111 hide_login_progress("Disconnected."); 111 hide_login_progress("Disconnected.");
112 return -1; 112 return -1;
113 } 113 }
114 114
115 g_snprintf(buf, sizeof(buf), "Waiting for reply..."); 115 g_snprintf(buf, sizeof(buf), "Waiting for reply...");
116 set_login_progress(4, buf); 116 set_login_progress(4, buf);
117 if (toc_wait_signon() < 0) { 117 if (toc_wait_signon() < 0) {
118 #ifdef USE_APPLET 118 #ifdef USE_APPLET
119 setUserState(offline); 119 set_user_state(offline);
120 #endif /* USE_APPLET */ 120 #endif /* USE_APPLET */
121 set_state(STATE_OFFLINE); 121 set_state(STATE_OFFLINE);
122 hide_login_progress("Authentication Failed"); 122 hide_login_progress("Authentication Failed");
123 return -1; 123 return -1;
124 } 124 }
141 g_snprintf(buf, sizeof(buf), "Retrieving config..."); 141 g_snprintf(buf, sizeof(buf), "Retrieving config...");
142 set_login_progress(5, buf); 142 set_login_progress(5, buf);
143 config = toc_wait_config(); 143 config = toc_wait_config();
144 state = STATE_ONLINE; 144 state = STATE_ONLINE;
145 145
146 #ifdef USE_APPLET
147 make_buddy();
148 if (general_options & OPT_GEN_APP_BUDDY_SHOW) {
149 gnome_buddy_show();
150 if (config != NULL)
151 parse_toc_buddy_list(config, 0);
152 else
153 do_import(0, 0);
154 createOnlinePopup();
155 set_applet_draw_open();
156 } else {
157 gnome_buddy_hide();
158 if (config != NULL)
159 parse_toc_buddy_list(config, 0);
160 else
161 do_import(0, 0);
162 set_applet_draw_closed();
163 }
164
165
166 setUserState(online);
167 gtk_widget_hide(mainwindow);
168 #else
169 gtk_widget_hide(mainwindow); 146 gtk_widget_hide(mainwindow);
170 show_buddy_list(); 147 show_buddy_list();
148 #ifdef USE_APPLET
149 if (general_options & OPT_GEN_APP_BUDDY_SHOW) {
150 refresh_buddy_window();
151 createOnlinePopup();
152 applet_buddy_show = TRUE;
153 } else {
154 gtk_widget_hide(blist);
155 applet_buddy_show = FALSE;
156 }
157
158 set_user_state(online);
159 #else
160 refresh_buddy_window();
161 #endif
171 if (config != NULL) 162 if (config != NULL)
172 parse_toc_buddy_list(config, 0); 163 parse_toc_buddy_list(config, 0);
173 else 164 else
174 do_import(0, 0); 165 do_import(0, 0);
175 refresh_buddy_window(); 166 refresh_buddy_window();
176 #endif
177 167
178 168
179 g_snprintf(buf2, sizeof(buf2), "toc_init_done"); 169 g_snprintf(buf2, sizeof(buf2), "toc_init_done");
180 sflap_send(buf2, -1, TYPE_DATA); 170 sflap_send(buf2, -1, TYPE_DATA);
181 171
189 } 179 }
190 180
191 void toc_close() 181 void toc_close()
192 { 182 {
193 #ifdef USE_APPLET 183 #ifdef USE_APPLET
194 setUserState(offline); 184 set_user_state(offline);
195 #endif /* USE_APPLET */ 185 #endif /* USE_APPLET */
196 seqno = 0; 186 seqno = 0;
197 state = STATE_OFFLINE; 187 state = STATE_OFFLINE;
198 if (inpa > 0) 188 if (inpa > 0)
199 gdk_input_remove(inpa); 189 gdk_input_remove(inpa);