Mercurial > pidgin
comparison src/protocols/irc/msgs.c @ 9238:f4f210e47b60
[gaim-migrate @ 10036]
This is Tim's patch from 908047. I'm committing it now instead of
letting him commit it so I can continue to feel relevant. If it
breaks, tell Tim. If it doesn't, I'll take the credit.
committer: Tailor Script <tailor@pidgin.im>
| author | Ethan Blanton <elb@pidgin.im> |
|---|---|
| date | Tue, 08 Jun 2004 05:34:51 +0000 |
| parents | c55aa23bf56e |
| children | f5c08be60098 |
comparison
equal
deleted
inserted
replaced
| 9237:fac583b4ecdf | 9238:f4f210e47b60 |
|---|---|
| 547 void irc_msg_join(struct irc_conn *irc, const char *name, const char *from, char **args) | 547 void irc_msg_join(struct irc_conn *irc, const char *name, const char *from, char **args) |
| 548 { | 548 { |
| 549 GaimConnection *gc = gaim_account_get_connection(irc->account); | 549 GaimConnection *gc = gaim_account_get_connection(irc->account); |
| 550 GaimConversation *convo; | 550 GaimConversation *convo; |
| 551 char *nick = irc_mask_nick(from), *userhost; | 551 char *nick = irc_mask_nick(from), *userhost; |
| 552 struct irc_buddy *ib; | |
| 552 static int id = 1; | 553 static int id = 1; |
| 553 | 554 |
| 554 if (!gc) { | 555 if (!gc) { |
| 555 g_free(nick); | 556 g_free(nick); |
| 556 return; | 557 return; |
| 570 return; | 571 return; |
| 571 } | 572 } |
| 572 | 573 |
| 573 userhost = irc_mask_userhost(from); | 574 userhost = irc_mask_userhost(from); |
| 574 gaim_conv_chat_add_user(GAIM_CONV_CHAT(convo), nick, userhost); | 575 gaim_conv_chat_add_user(GAIM_CONV_CHAT(convo), nick, userhost); |
| 576 | |
| 577 if ((ib = g_hash_table_lookup(irc->buddies, nick)) != NULL) { | |
| 578 ib->flag = TRUE; | |
| 579 irc_buddy_status(nick, ib, irc); | |
| 580 } | |
| 581 | |
| 575 g_free(userhost); | 582 g_free(userhost); |
| 576 g_free(nick); | 583 g_free(nick); |
| 577 } | 584 } |
| 578 | 585 |
| 579 void irc_msg_kick(struct irc_conn *irc, const char *name, const char *from, char **args) | 586 void irc_msg_kick(struct irc_conn *irc, const char *name, const char *from, char **args) |
| 844 } | 851 } |
| 845 | 852 |
| 846 void irc_msg_quit(struct irc_conn *irc, const char *name, const char *from, char **args) | 853 void irc_msg_quit(struct irc_conn *irc, const char *name, const char *from, char **args) |
| 847 { | 854 { |
| 848 GaimConnection *gc = gaim_account_get_connection(irc->account); | 855 GaimConnection *gc = gaim_account_get_connection(irc->account); |
| 856 struct irc_buddy *ib; | |
| 849 char *data[2]; | 857 char *data[2]; |
| 850 | 858 |
| 851 if (!args || !args[0] || !gc) | 859 if (!args || !args[0] || !gc) |
| 852 return; | 860 return; |
| 853 | 861 |
| 854 data[0] = irc_mask_nick(from); | 862 data[0] = irc_mask_nick(from); |
| 855 data[1] = args[0]; | 863 data[1] = args[0]; |
| 856 /* XXX this should have an API, I shouldn't grab this directly */ | 864 /* XXX this should have an API, I shouldn't grab this directly */ |
| 857 g_slist_foreach(gc->buddy_chats, (GFunc)irc_chat_remove_buddy, data); | 865 g_slist_foreach(gc->buddy_chats, (GFunc)irc_chat_remove_buddy, data); |
| 866 | |
| 867 if ((ib = g_hash_table_lookup(irc->buddies, data[0])) != NULL) { | |
| 868 ib->flag = FALSE; | |
| 869 irc_buddy_status(data[0], ib, irc); | |
| 870 } | |
| 858 g_free(data[0]); | 871 g_free(data[0]); |
| 859 | 872 |
| 860 return; | 873 return; |
| 861 } | 874 } |
| 862 | 875 |
