src/protocols/irc/msgs.c

changeset 6621
2a18ef3e5224
parent 6407
d67b6a6ba7d2
child 6622
277eb0b14653
equal deleted inserted replaced
6620:0df472b1b7ff 6621:2a18ef3e5224
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;

mercurial