comparison src/protocols/irc/msgs.c @ 6621:42fdf16f1dad

[gaim-migrate @ 7145] Individual accounts remember the "No Proxy" setting instead of reverting back to "Use Global Proxy Settings" Proxy settings for individual accounts do not revert to "No Proxy" if you open an account, don't change the proxy drop down, then save the account. Those two sound like the same thing, but they're different. I think. Added the "use environmental variables" setting in a way that isn't horrible. We're not using that thing that splits the proxy variable into host:port yet. I'll do that later. I would have done that earlier, but I had to go buy a bike. Also, I'd like to show what the environmental variables are set to somewhere. That'll come later. Also a patch from Robot101: (22:10:25) Bzubhipheron: I have a patch that replaces #define WFLAG_* with GaimMessageFlags GAIM_MESSAGE_* (22:10:30) Bzubhipheron: (an enum in disguise) (22:14:18) Bzubhipheron: GaimMessageFlags protrays much better typing information than "int". most of the other #defines are gone, and glib standardises on enums for its flags too. (22:14:27) Bzubhipheron: (gone or going) (22:14:45) Bzubhipheron: and it makes the prototype of my message queueing stuff prettier. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 25 Aug 2003 02:49:42 +0000
parents ba0b99a72be2
children a4622f1fb5a1
comparison
equal deleted inserted replaced
6620:7230e5920911 6621:42fdf16f1dad
125 convo = gaim_find_conversation_with_account(args[1], irc->account); 125 convo = gaim_find_conversation_with_account(args[1], irc->account);
126 if (!convo) /* XXX punt on channels we are not in for now */ 126 if (!convo) /* XXX punt on channels we are not in for now */
127 return; 127 return;
128 128
129 buf = g_strdup_printf("mode for %s: %s %s", args[1], args[2], args[3] ? args[3] : ""); 129 buf = g_strdup_printf("mode for %s: %s %s", args[1], args[2], args[3] ? args[3] : "");
130 gaim_chat_write(GAIM_CHAT(convo), "", buf, WFLAG_SYSTEM|WFLAG_NOLOG, time(NULL)); 130 gaim_chat_write(GAIM_CHAT(convo), "", buf, GAIM_MESSAGE_SYSTEM|GAIM_MESSAGE_NO_LOG, time(NULL));
131 g_free(buf); 131 g_free(buf);
132 132
133 return; 133 return;
134 } 134 }
135 135
242 /* If this is an interactive update, print it out */ 242 /* If this is an interactive update, print it out */
243 if (!strcmp(name, "topic")) { 243 if (!strcmp(name, "topic")) {
244 nick = irc_mask_nick(from); 244 nick = irc_mask_nick(from);
245 msg = g_strdup_printf(_("%s has changed the topic to: %s"), nick, topic); 245 msg = g_strdup_printf(_("%s has changed the topic to: %s"), nick, topic);
246 g_free(nick); 246 g_free(nick);
247 gaim_chat_write(GAIM_CHAT(convo), from, msg, WFLAG_SYSTEM, time(NULL)); 247 gaim_chat_write(GAIM_CHAT(convo), from, msg, GAIM_MESSAGE_SYSTEM, time(NULL));
248 g_free(msg); 248 g_free(msg);
249 } else { 249 } else {
250 msg = g_strdup_printf(_("The topic for %s is: %s"), chan, topic); 250 msg = g_strdup_printf(_("The topic for %s is: %s"), chan, topic);
251 gaim_chat_write(GAIM_CHAT(convo), "", msg, WFLAG_SYSTEM, time(NULL)); 251 gaim_chat_write(GAIM_CHAT(convo), "", msg, GAIM_MESSAGE_SYSTEM, time(NULL));
252 g_free(msg); 252 g_free(msg);
253 } 253 }
254 } 254 }
255 255
256 void irc_msg_unknown(struct irc_conn *irc, const char *name, const char *from, char **args) 256 void irc_msg_unknown(struct irc_conn *irc, const char *name, const char *from, char **args)
285 names = cur = g_string_free(irc->names, FALSE); 285 names = cur = g_string_free(irc->names, FALSE);
286 irc->names = NULL; 286 irc->names = NULL;
287 if (irc->nameconv) { 287 if (irc->nameconv) {
288 msg = g_strdup_printf("Users on %s: %s", args[1], names); 288 msg = g_strdup_printf("Users on %s: %s", args[1], names);
289 if (gaim_conversation_get_type(convo) == GAIM_CONV_CHAT) 289 if (gaim_conversation_get_type(convo) == GAIM_CONV_CHAT)
290 gaim_chat_write(GAIM_CHAT(convo), "", msg, WFLAG_SYSTEM|WFLAG_NOLOG, time(NULL)); 290 gaim_chat_write(GAIM_CHAT(convo), "", msg, GAIM_MESSAGE_SYSTEM|GAIM_MESSAGE_NO_LOG, time(NULL));
291 else 291 else
292 gaim_im_write(GAIM_IM(convo), "", msg, -1, WFLAG_SYSTEM|WFLAG_NOLOG, time(NULL)); 292 gaim_im_write(GAIM_IM(convo), "", msg, -1, GAIM_MESSAGE_SYSTEM|GAIM_MESSAGE_NO_LOG, time(NULL));
293 g_free(msg); 293 g_free(msg);
294 g_free(irc->nameconv); 294 g_free(irc->nameconv);
295 irc->nameconv = NULL; 295 irc->nameconv = NULL;
296 } else { 296 } else {
297 GList *users = NULL; 297 GList *users = NULL;
365 365
366 convo = gaim_find_conversation_with_account(args[1], irc->account); 366 convo = gaim_find_conversation_with_account(args[1], irc->account);
367 if (convo) { 367 if (convo) {
368 if (gaim_conversation_get_type(convo) == GAIM_CONV_CHAT) /* does this happen? */ 368 if (gaim_conversation_get_type(convo) == GAIM_CONV_CHAT) /* does this happen? */
369 gaim_chat_write(GAIM_CHAT(convo), args[1], _("no such channel"), 369 gaim_chat_write(GAIM_CHAT(convo), args[1], _("no such channel"),
370 WFLAG_SYSTEM|WFLAG_NOLOG, time(NULL)); 370 GAIM_MESSAGE_SYSTEM|GAIM_MESSAGE_NO_LOG, time(NULL));
371 else 371 else
372 gaim_im_write(GAIM_IM(convo), args[1], _("User is not logged in"), -1, 372 gaim_im_write(GAIM_IM(convo), args[1], _("User is not logged in"), -1,
373 WFLAG_SYSTEM|WFLAG_NOLOG, time(NULL)); 373 GAIM_MESSAGE_SYSTEM|GAIM_MESSAGE_NO_LOG, time(NULL));
374 } else { 374 } else {
375 if ((gc = gaim_account_get_connection(irc->account)) == NULL) 375 if ((gc = gaim_account_get_connection(irc->account)) == NULL)
376 return; 376 return;
377 gaim_notify_error(gc, NULL, _("No such nick or channel"), args[1]); 377 gaim_notify_error(gc, NULL, _("No such nick or channel"), args[1]);
378 } 378 }
388 GaimConnection *gc; 388 GaimConnection *gc;
389 GaimConversation *convo; 389 GaimConversation *convo;
390 390
391 convo = gaim_find_conversation_with_account(args[1], irc->account); 391 convo = gaim_find_conversation_with_account(args[1], irc->account);
392 if (convo) { 392 if (convo) {
393 gaim_chat_write(GAIM_CHAT(convo), args[1], args[2], WFLAG_SYSTEM|WFLAG_NOLOG, time(NULL)); 393 gaim_chat_write(GAIM_CHAT(convo), args[1], args[2], GAIM_MESSAGE_SYSTEM|GAIM_MESSAGE_NO_LOG, time(NULL));
394 } else { 394 } else {
395 if ((gc = gaim_account_get_connection(irc->account)) == NULL) 395 if ((gc = gaim_account_get_connection(irc->account)) == NULL)
396 return; 396 return;
397 gaim_notify_error(gc, NULL, _("Could not send"), args[2]); 397 gaim_notify_error(gc, NULL, _("Could not send"), args[2]);
398 } 398 }
404 404
405 gaim_debug(GAIM_DEBUG_INFO, "irc", "We're apparently not in %s, but tried to use it\n", args[1]); 405 gaim_debug(GAIM_DEBUG_INFO, "irc", "We're apparently not in %s, but tried to use it\n", args[1]);
406 if (convo) { 406 if (convo) {
407 /*g_slist_remove(irc->gc->buddy_chats, convo); 407 /*g_slist_remove(irc->gc->buddy_chats, convo);
408 gaim_conversation_set_account(convo, NULL);*/ 408 gaim_conversation_set_account(convo, NULL);*/
409 gaim_chat_write(GAIM_CHAT(convo), args[1], args[2], WFLAG_SYSTEM|WFLAG_NOLOG, time(NULL)); 409 gaim_chat_write(GAIM_CHAT(convo), args[1], args[2], GAIM_MESSAGE_SYSTEM|GAIM_MESSAGE_NO_LOG, time(NULL));
410 } 410 }
411 } 411 }
412 412
413 void irc_msg_notop(struct irc_conn *irc, const char *name, const char *from, char **args) 413 void irc_msg_notop(struct irc_conn *irc, const char *name, const char *from, char **args)
414 { 414 {
419 419
420 convo = gaim_find_conversation_with_account(args[1], irc->account); 420 convo = gaim_find_conversation_with_account(args[1], irc->account);
421 if (!convo) 421 if (!convo)
422 return; 422 return;
423 423
424 gaim_chat_write(GAIM_CHAT(convo), "", args[2], WFLAG_SYSTEM, time(NULL)); 424 gaim_chat_write(GAIM_CHAT(convo), "", args[2], GAIM_MESSAGE_SYSTEM, time(NULL));
425 } 425 }
426 426
427 void irc_msg_invite(struct irc_conn *irc, const char *name, const char *from, char **args) 427 void irc_msg_invite(struct irc_conn *irc, const char *name, const char *from, char **args)
428 { 428 {
429 GaimConnection *gc = gaim_account_get_connection(irc->account); 429 GaimConnection *gc = gaim_account_get_connection(irc->account);
546 return; 546 return;
547 } 547 }
548 548
549 if (!gaim_utf8_strcasecmp(gaim_connection_get_display_name(gc), args[1])) { 549 if (!gaim_utf8_strcasecmp(gaim_connection_get_display_name(gc), args[1])) {
550 buf = g_strdup_printf(_("You have been kicked by %s: (%s)"), nick, args[2]); 550 buf = g_strdup_printf(_("You have been kicked by %s: (%s)"), nick, args[2]);
551 gaim_chat_write(GAIM_CHAT(convo), args[0], buf, WFLAG_SYSTEM, time(NULL)); 551 gaim_chat_write(GAIM_CHAT(convo), args[0], buf, GAIM_MESSAGE_SYSTEM, time(NULL));
552 g_free(buf); 552 g_free(buf);
553 /*g_slist_remove(irc->gc->buddy_chats, convo); 553 /*g_slist_remove(irc->gc->buddy_chats, convo);
554 gaim_conversation_set_account(convo, NULL);*/ 554 gaim_conversation_set_account(convo, NULL);*/
555 /*g_list_free(gaim_chat_get_users(GAIM_CHAT(convo))); 555 /*g_list_free(gaim_chat_get_users(GAIM_CHAT(convo)));
556 gaim_chat_set_users(GAIM_CHAT(convo), NULL);*/ 556 gaim_chat_set_users(GAIM_CHAT(convo), NULL);*/
575 gaim_debug(GAIM_DEBUG_ERROR, "irc", "MODE received for %s, which we are not in\n", args[0]); 575 gaim_debug(GAIM_DEBUG_ERROR, "irc", "MODE received for %s, which we are not in\n", args[0]);
576 g_free(nick); 576 g_free(nick);
577 return; 577 return;
578 } 578 }
579 buf = g_strdup_printf(_("mode (%s %s) by %s"), args[1], args[2] ? args[2] : "", nick); 579 buf = g_strdup_printf(_("mode (%s %s) by %s"), args[1], args[2] ? args[2] : "", nick);
580 gaim_chat_write(GAIM_CHAT(convo), args[0], buf, WFLAG_SYSTEM|WFLAG_NOLOG, time(NULL)); 580 gaim_chat_write(GAIM_CHAT(convo), args[0], buf, GAIM_MESSAGE_SYSTEM|GAIM_MESSAGE_NO_LOG, time(NULL));
581 g_free(buf); 581 g_free(buf);
582 } else { /* User */ 582 } else { /* User */
583 } 583 }
584 g_free(nick); 584 g_free(nick);
585 } 585 }
663 } 663 }
664 664
665 nick = irc_mask_nick(from); 665 nick = irc_mask_nick(from);
666 if (!gaim_utf8_strcasecmp(nick, gaim_connection_get_display_name(gc))) { 666 if (!gaim_utf8_strcasecmp(nick, gaim_connection_get_display_name(gc))) {
667 msg = g_strdup_printf(_("You have parted the channel%s%s"), *args[1] ? ": " : "", args[1]); 667 msg = g_strdup_printf(_("You have parted the channel%s%s"), *args[1] ? ": " : "", args[1]);
668 gaim_chat_write(GAIM_CHAT(convo), args[0], msg, WFLAG_SYSTEM, time(NULL)); 668 gaim_chat_write(GAIM_CHAT(convo), args[0], msg, GAIM_MESSAGE_SYSTEM, time(NULL));
669 g_free(msg); 669 g_free(msg);
670 } else { 670 } else {
671 gaim_chat_remove_user(GAIM_CHAT(convo), nick, args[1]); 671 gaim_chat_remove_user(GAIM_CHAT(convo), nick, args[1]);
672 } 672 }
673 g_free(nick); 673 g_free(nick);
709 709
710 convo = gaim_find_conversation_with_account(parts[0], irc->account); 710 convo = gaim_find_conversation_with_account(parts[0], irc->account);
711 g_strfreev(parts); 711 g_strfreev(parts);
712 if (convo) { 712 if (convo) {
713 if (gaim_conversation_get_type (convo) == GAIM_CONV_CHAT) 713 if (gaim_conversation_get_type (convo) == GAIM_CONV_CHAT)
714 gaim_chat_write(GAIM_CHAT(convo), "PONG", msg, WFLAG_SYSTEM|WFLAG_NOLOG, time(NULL)); 714 gaim_chat_write(GAIM_CHAT(convo), "PONG", msg, GAIM_MESSAGE_SYSTEM|GAIM_MESSAGE_NO_LOG, time(NULL));
715 else 715 else
716 gaim_im_write(GAIM_IM(convo), "PONG", msg, -1, WFLAG_SYSTEM|WFLAG_NOLOG, time(NULL)); 716 gaim_im_write(GAIM_IM(convo), "PONG", msg, -1, GAIM_MESSAGE_SYSTEM|GAIM_MESSAGE_NO_LOG, time(NULL));
717 } else { 717 } else {
718 gc = gaim_account_get_connection(irc->account); 718 gc = gaim_account_get_connection(irc->account);
719 if (!gc) { 719 if (!gc) {
720 g_free(msg); 720 g_free(msg);
721 return; 721 return;