comparison src/server.c @ 6059:d8cd876e613e

[gaim-migrate @ 6509] I made a lot of server.c functions use const chat * instead of const * Made the alias entry have focus in the alias buddy dialog. Fixed a typo thanks to J. Silvestri committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Tue, 08 Jul 2003 03:36:41 +0000
parents d5f4ae4f9a02
children 2cd7c409d71d
comparison
equal deleted inserted replaced
6058:d5f4ae4f9a02 6059:d8cd876e613e
167 167
168 /* This should return the elapsed time in seconds in which Gaim will not send 168 /* This should return the elapsed time in seconds in which Gaim will not send
169 * typing notifications. 169 * typing notifications.
170 * if it returns zero, it will not send any more typing notifications 170 * if it returns zero, it will not send any more typing notifications
171 * typing is a flag - TRUE for typing, FALSE for stopped typing */ 171 * typing is a flag - TRUE for typing, FALSE for stopped typing */
172 int serv_send_typing(GaimConnection *g, char *name, int typing) { 172 int serv_send_typing(GaimConnection *g, const char *name, int typing) {
173 GaimPluginProtocolInfo *prpl_info = NULL; 173 GaimPluginProtocolInfo *prpl_info = NULL;
174 174
175 if (g != NULL && g->prpl != NULL) 175 if (g != NULL && g->prpl != NULL)
176 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl); 176 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl);
177 177
184 struct queued_away_response { 184 struct queued_away_response {
185 char name[80]; 185 char name[80];
186 time_t sent_away; 186 time_t sent_away;
187 }; 187 };
188 188
189 struct queued_away_response *find_queued_away_response_by_name(char *name); 189 struct queued_away_response *find_queued_away_response_by_name(const char *name);
190 190
191 int serv_send_im(GaimConnection *gc, char *name, char *message, 191 int serv_send_im(GaimConnection *gc, const char *name, const char *message,
192 int len, int flags) 192 int len, int flags)
193 { 193 {
194 GaimConversation *c; 194 GaimConversation *c;
195 int val = -EINVAL; 195 int val = -EINVAL;
196 GaimPluginProtocolInfo *prpl_info = NULL; 196 GaimPluginProtocolInfo *prpl_info = NULL;
227 gaim_im_stop_type_again_timeout(GAIM_IM(c)); 227 gaim_im_stop_type_again_timeout(GAIM_IM(c));
228 228
229 return val; 229 return val;
230 } 230 }
231 231
232 void serv_get_info(GaimConnection *g, char *name) 232 void serv_get_info(GaimConnection *g, const char *name)
233 { 233 {
234 GaimPluginProtocolInfo *prpl_info = NULL; 234 GaimPluginProtocolInfo *prpl_info = NULL;
235 235
236 if (g != NULL && g->prpl != NULL) 236 if (g != NULL && g->prpl != NULL)
237 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl); 237 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl);
249 249
250 if (g && prpl_info && prpl_info->get_away) 250 if (g && prpl_info && prpl_info->get_away)
251 prpl_info->get_away(g, name); 251 prpl_info->get_away(g, name);
252 } 252 }
253 253
254 void serv_get_dir(GaimConnection *g, char *name) 254 void serv_get_dir(GaimConnection *g, const char *name)
255 { 255 {
256 GaimPluginProtocolInfo *prpl_info = NULL; 256 GaimPluginProtocolInfo *prpl_info = NULL;
257 257
258 if (g != NULL && g->prpl != NULL) 258 if (g != NULL && g->prpl != NULL)
259 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl); 259 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl);
291 prpl_info->dir_search(g, first, middle, last, maiden, city, state, 291 prpl_info->dir_search(g, first, middle, last, maiden, city, state,
292 country, email); 292 country, email);
293 } 293 }
294 294
295 295
296 void serv_set_away(GaimConnection *gc, char *state, char *message) 296 void serv_set_away(GaimConnection *gc, const char *state, const char *message)
297 { 297 {
298 GaimPluginProtocolInfo *prpl_info = NULL; 298 GaimPluginProtocolInfo *prpl_info = NULL;
299 299
300 if (gc->away_state == NULL && state == NULL && 300 if (gc->away_state == NULL && state == NULL &&
301 gc->away == NULL && message == NULL) { 301 gc->away == NULL && message == NULL) {
331 } 331 }
332 332
333 system_log(log_away, gc, NULL, OPT_LOG_BUDDY_AWAY | OPT_LOG_MY_SIGNON); 333 system_log(log_away, gc, NULL, OPT_LOG_BUDDY_AWAY | OPT_LOG_MY_SIGNON);
334 } 334 }
335 335
336 void serv_set_away_all(char *message) 336 void serv_set_away_all(const char *message)
337 { 337 {
338 GList *c; 338 GList *c;
339 GaimConnection *g; 339 GaimConnection *g;
340 340
341 for (c = gaim_connections_get_all(); c != NULL; c = c->next) { 341 for (c = gaim_connections_get_all(); c != NULL; c = c->next) {
400 } 400 }
401 } 401 }
402 } 402 }
403 403
404 404
405 void serv_remove_buddy(GaimConnection *g, char *name, char *group) 405 void serv_remove_buddy(GaimConnection *g, const char *name, const char *group)
406 { 406 {
407 GaimPluginProtocolInfo *prpl_info = NULL; 407 GaimPluginProtocolInfo *prpl_info = NULL;
408 408
409 if (g != NULL && g->prpl != NULL) 409 if (g != NULL && g->prpl != NULL)
410 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl); 410 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl);
411 411
412 if (prpl_info && g_list_find(gaim_connections_get_all(), g) && prpl_info->remove_buddy) 412 if (prpl_info && g_list_find(gaim_connections_get_all(), g) && prpl_info->remove_buddy)
413 prpl_info->remove_buddy(g, name, group); 413 prpl_info->remove_buddy(g, name, group);
414 } 414 }
415 415
416 void serv_remove_buddies(GaimConnection *gc, GList *g, char *group) 416 void serv_remove_buddies(GaimConnection *gc, GList *g, const char *group)
417 { 417 {
418 GaimPluginProtocolInfo *prpl_info = NULL; 418 GaimPluginProtocolInfo *prpl_info = NULL;
419 419
420 if (!g_list_find(gaim_connections_get_all(), gc)) 420 if (!g_list_find(gaim_connections_get_all(), gc))
421 return; 421 return;
588 588
589 if (prpl_info && g_list_find(gaim_connections_get_all(), g) && prpl_info->set_idle) 589 if (prpl_info && g_list_find(gaim_connections_get_all(), g) && prpl_info->set_idle)
590 prpl_info->set_idle(g, time); 590 prpl_info->set_idle(g, time);
591 } 591 }
592 592
593 void serv_warn(GaimConnection *g, char *name, int anon) 593 void serv_warn(GaimConnection *g, const char *name, int anon)
594 { 594 {
595 GaimPluginProtocolInfo *prpl_info = NULL; 595 GaimPluginProtocolInfo *prpl_info = NULL;
596 596
597 if (g != NULL && g->prpl != NULL) 597 if (g != NULL && g->prpl != NULL)
598 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl); 598 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl);
641 641
642 if (prpl_info && prpl_info->chat_leave) 642 if (prpl_info && prpl_info->chat_leave)
643 prpl_info->chat_leave(g, id); 643 prpl_info->chat_leave(g, id);
644 } 644 }
645 645
646 void serv_chat_whisper(GaimConnection *g, int id, char *who, char *message) 646 void serv_chat_whisper(GaimConnection *g, int id, const char *who, const char *message)
647 { 647 {
648 GaimPluginProtocolInfo *prpl_info = NULL; 648 GaimPluginProtocolInfo *prpl_info = NULL;
649 649
650 if (g != NULL && g->prpl != NULL) 650 if (g != NULL && g->prpl != NULL)
651 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl); 651 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl);
652 652
653 if (prpl_info && prpl_info->chat_whisper) 653 if (prpl_info && prpl_info->chat_whisper)
654 prpl_info->chat_whisper(g, id, who, message); 654 prpl_info->chat_whisper(g, id, who, message);
655 } 655 }
656 656
657 int serv_chat_send(GaimConnection *g, int id, char *message) 657 int serv_chat_send(GaimConnection *g, int id, const char *message)
658 { 658 {
659 int val = -EINVAL; 659 int val = -EINVAL;
660 GaimPluginProtocolInfo *prpl_info = NULL; 660 GaimPluginProtocolInfo *prpl_info = NULL;
661 661
662 if (g->prpl != NULL) 662 if (g->prpl != NULL)
719 } 719 }
720 720
721 return i; 721 return i;
722 } 722 }
723 723
724 struct queued_away_response *find_queued_away_response_by_name(char *name) 724 struct queued_away_response *find_queued_away_response_by_name(const char *name)
725 { 725 {
726 GSList *templist; 726 GSList *templist;
727 struct queued_away_response *qar; 727 struct queued_away_response *qar;
728 728
729 templist = away_time_queue; 729 templist = away_time_queue;
1347 g->buddy_chats = g_slist_remove(g->buddy_chats, conv); 1347 g->buddy_chats = g_slist_remove(g->buddy_chats, conv);
1348 1348
1349 gaim_conversation_destroy(conv); 1349 gaim_conversation_destroy(conv);
1350 } 1350 }
1351 1351
1352 void serv_got_chat_in(GaimConnection *g, int id, char *who, 1352 void serv_got_chat_in(GaimConnection *g, int id, const char *who,
1353 int whisper, char *message, time_t mtime) 1353 int whisper, const char *message, time_t mtime)
1354 { 1354 {
1355 int w; 1355 int w;
1356 GSList *bcs; 1356 GSList *bcs;
1357 GaimConversation *conv = NULL; 1357 GaimConversation *conv = NULL;
1358 GaimChat *chat = NULL; 1358 GaimChat *chat = NULL;
1410 else 1410 else
1411 w = 0; 1411 w = 0;
1412 1412
1413 gaim_chat_write(chat, who, buf, w, mtime); 1413 gaim_chat_write(chat, who, buf, w, mtime);
1414 1414
1415 g_free(who);
1416 g_free(message);
1417 g_free(buf); 1415 g_free(buf);
1418 } 1416 }
1419 1417
1420 static void des_popup(GtkWidget *w, GtkWidget *window) 1418 static void des_popup(GtkWidget *w, GtkWidget *window)
1421 { 1419 {
1424 g_free(u); 1422 g_free(u);
1425 } 1423 }
1426 gtk_widget_destroy(window); 1424 gtk_widget_destroy(window);
1427 } 1425 }
1428 1426
1429 void serv_got_popup(char *msg, char *u, int wid, int hei) 1427 void serv_got_popup(const char *msg, const char *u, int wid, int hei)
1430 { 1428 {
1431 GtkWidget *window; 1429 GtkWidget *window;
1432 GtkWidget *vbox; 1430 GtkWidget *vbox;
1433 GtkWidget *sw; 1431 GtkWidget *sw;
1434 GtkWidget *text; 1432 GtkWidget *text;