Mercurial > pidgin.yaz
comparison src/protocols/irc/irc.c @ 9015:67421e0dc497
[gaim-migrate @ 9791]
(05:54:53) siege: that's the first pass on merging the two action sources
(05:55:27) siege: using it right now, seems to be working fine. You may
want to look it over though...
(05:56:04) siege: found a small mem-leak in a GList getting created and not
destroyed, this fixes that as well
(13:20:40) KingAnt: LSchiere: Well it's probably ok. I haven't even had a
chance to look at the commit for the other thing
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Sat, 22 May 2004 17:33:38 +0000 |
parents | 294ae6548d4e |
children | 7ab20f829190 |
comparison
equal
deleted
inserted
replaced
9014:51b5b3a622ce | 9015:67421e0dc497 |
---|---|
39 static void irc_buddy_append(char *name, struct irc_buddy *ib, GString *string); | 39 static void irc_buddy_append(char *name, struct irc_buddy *ib, GString *string); |
40 | 40 |
41 static const char *irc_blist_icon(GaimAccount *a, GaimBuddy *b); | 41 static const char *irc_blist_icon(GaimAccount *a, GaimBuddy *b); |
42 static void irc_blist_emblems(GaimBuddy *b, char **se, char **sw, char **nw, char **ne); | 42 static void irc_blist_emblems(GaimBuddy *b, char **se, char **sw, char **nw, char **ne); |
43 static GList *irc_away_states(GaimConnection *gc); | 43 static GList *irc_away_states(GaimConnection *gc); |
44 static GList *irc_actions(GaimConnection *gc); | 44 static GList *irc_actions(GaimPlugin *plugin, gpointer context); |
45 /* static GList *irc_chat_info(GaimConnection *gc); */ | 45 /* static GList *irc_chat_info(GaimConnection *gc); */ |
46 static void irc_login(GaimAccount *account); | 46 static void irc_login(GaimAccount *account); |
47 static void irc_login_cb(gpointer data, gint source, GaimInputCondition cond); | 47 static void irc_login_cb(gpointer data, gint source, GaimInputCondition cond); |
48 static void irc_close(GaimConnection *gc); | 48 static void irc_close(GaimConnection *gc); |
49 static int irc_im_send(GaimConnection *gc, const char *who, const char *what, GaimConvImFlags flags); | 49 static int irc_im_send(GaimConnection *gc, const char *who, const char *what, GaimConvImFlags flags); |
57 | 57 |
58 static GaimPlugin *_irc_plugin = NULL; | 58 static GaimPlugin *_irc_plugin = NULL; |
59 | 59 |
60 static const char *status_chars = "@+%&"; | 60 static const char *status_chars = "@+%&"; |
61 | 61 |
62 static void irc_view_motd(GaimConnection *gc) | 62 static void irc_view_motd(GaimPluginAction *action) |
63 { | 63 { |
64 GaimConnection *gc = (GaimConnection *) action->context; | |
64 struct irc_conn *irc; | 65 struct irc_conn *irc; |
65 char *title; | 66 char *title; |
66 | 67 |
67 if (gc == NULL || gc->proto_data == NULL) { | 68 if (gc == NULL || gc->proto_data == NULL) { |
68 gaim_debug(GAIM_DEBUG_ERROR, "irc", "got MOTD request for NULL gc\n"); | 69 gaim_debug(GAIM_DEBUG_ERROR, "irc", "got MOTD request for NULL gc\n"); |
129 static GList *irc_away_states(GaimConnection *gc) | 130 static GList *irc_away_states(GaimConnection *gc) |
130 { | 131 { |
131 return g_list_append(NULL, (gpointer)GAIM_AWAY_CUSTOM); | 132 return g_list_append(NULL, (gpointer)GAIM_AWAY_CUSTOM); |
132 } | 133 } |
133 | 134 |
134 static GList *irc_actions(GaimConnection *gc) | 135 static GList *irc_actions(GaimPlugin *plugin, gpointer context) |
135 { | 136 { |
136 struct proto_actions_menu *pam; | |
137 GList *list = NULL; | 137 GList *list = NULL; |
138 | 138 GaimPluginAction *act = NULL; |
139 pam = g_new0(struct proto_actions_menu, 1); | 139 |
140 pam->label = _("View MOTD"); | 140 act = gaim_plugin_action_new(_("View MOTD"), irc_view_motd); |
141 pam->callback = irc_view_motd; | 141 list = g_list_append(list, act); |
142 pam->gc = gc; | |
143 list = g_list_append(list, pam); | |
144 | 142 |
145 return list; | 143 return list; |
146 } | 144 } |
147 | 145 |
148 static GList *irc_buddy_menu(GaimConnection *gc, const char *who) | 146 static GList *irc_buddy_menu(GaimConnection *gc, const char *who) |
545 irc_blist_icon, | 543 irc_blist_icon, |
546 irc_blist_emblems, | 544 irc_blist_emblems, |
547 NULL, | 545 NULL, |
548 NULL, | 546 NULL, |
549 irc_away_states, | 547 irc_away_states, |
550 irc_actions, | |
551 irc_buddy_menu, | 548 irc_buddy_menu, |
552 irc_chat_join_info, | 549 irc_chat_join_info, |
553 irc_login, | 550 irc_login, |
554 irc_close, | 551 irc_close, |
555 irc_im_send, | 552 irc_im_send, |
619 NULL, /**< destroy */ | 616 NULL, /**< destroy */ |
620 | 617 |
621 NULL, /**< ui_info */ | 618 NULL, /**< ui_info */ |
622 &prpl_info, /**< extra_info */ | 619 &prpl_info, /**< extra_info */ |
623 NULL, | 620 NULL, |
624 NULL | 621 irc_actions |
625 }; | 622 }; |
626 | 623 |
627 static void _init_plugin(GaimPlugin *plugin) | 624 static void _init_plugin(GaimPlugin *plugin) |
628 { | 625 { |
629 GaimAccountUserSplit *split; | 626 GaimAccountUserSplit *split; |