Mercurial > pidgin
comparison src/protocols/jabber/jabber.c @ 3572:bdd0bebd2d04
[gaim-migrate @ 3670]
Phase II. No longer do you have to worry about protocol plugins. When
Gaim probes plugins on load, it will detect protocol plugins and add them
to the list of available protocols. When you try to log an account on with
one of them, Gaim will automatically load the plugin--when no more accounts
need the protocol--Gaim will automatically unload it. Protocol plugins are
no longer available in the plugins ui, and no protocols are compiled statically
by default.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Mon, 30 Sep 2002 01:05:18 +0000 |
parents | 8e688863a9f1 |
children | a662c133d1fd |
comparison
equal
deleted
inserted
replaced
3571:a88c62c5b7da | 3572:bdd0bebd2d04 |
---|---|
222 */ | 222 */ |
223 #define JCS_PENDING 1 /* pending */ | 223 #define JCS_PENDING 1 /* pending */ |
224 #define JCS_ACTIVE 2 /* active */ | 224 #define JCS_ACTIVE 2 /* active */ |
225 #define JCS_CLOSED 3 /* closed */ | 225 #define JCS_CLOSED 3 /* closed */ |
226 | 226 |
227 | |
228 static char *jabber_name() | |
229 { | |
230 return "Jabber"; | |
231 } | |
232 | 227 |
233 #define STATE_EVT(arg) if(gjc->on_state) { (gjc->on_state)(gjc, (arg) ); } | 228 #define STATE_EVT(arg) if(gjc->on_state) { (gjc->on_state)(gjc, (arg) ); } |
234 | 229 |
235 static void jabber_handlevcard(gjconn, xmlnode, char *); | 230 static void jabber_handlevcard(gjconn, xmlnode, char *); |
236 | 231 |
3191 static void jabber_keepalive(struct gaim_connection *gc) { | 3186 static void jabber_keepalive(struct gaim_connection *gc) { |
3192 struct jabber_data *jd = (struct jabber_data *)gc->proto_data; | 3187 struct jabber_data *jd = (struct jabber_data *)gc->proto_data; |
3193 gjab_send_raw(jd->gjc, " \t "); | 3188 gjab_send_raw(jd->gjc, " \t "); |
3194 } | 3189 } |
3195 | 3190 |
3196 static GList *jabber_user_opts() | |
3197 { | |
3198 GList *m = NULL; | |
3199 struct proto_user_opt *puo; | |
3200 | |
3201 puo = g_new0(struct proto_user_opt, 1); | |
3202 puo->label = "Port:"; | |
3203 puo->def = "5222"; | |
3204 puo->pos = USEROPT_PORT; | |
3205 m = g_list_append(m, puo); | |
3206 | |
3207 return m; | |
3208 } | |
3209 | |
3210 /*---------------------------------------*/ | 3191 /*---------------------------------------*/ |
3211 /* Jabber "set info" (vCard) support */ | 3192 /* Jabber "set info" (vCard) support */ |
3212 /*---------------------------------------*/ | 3193 /*---------------------------------------*/ |
3213 | 3194 |
3214 /* | 3195 /* |
3980 static struct prpl *my_protocol = NULL; | 3961 static struct prpl *my_protocol = NULL; |
3981 | 3962 |
3982 void jabber_init(struct prpl *ret) | 3963 void jabber_init(struct prpl *ret) |
3983 { | 3964 { |
3984 /* the NULL's aren't required but they're nice to have */ | 3965 /* the NULL's aren't required but they're nice to have */ |
3966 struct proto_user_opt *puo; | |
3985 ret->protocol = PROTO_JABBER; | 3967 ret->protocol = PROTO_JABBER; |
3986 ret->options = OPT_PROTO_UNIQUE_CHATNAME | OPT_PROTO_CHAT_TOPIC; | 3968 ret->options = OPT_PROTO_UNIQUE_CHATNAME | OPT_PROTO_CHAT_TOPIC; |
3987 ret->name = jabber_name; | 3969 ret->name = g_strdup("Jabber"); |
3988 ret->list_icon = jabber_list_icon; | 3970 ret->list_icon = jabber_list_icon; |
3989 ret->away_states = jabber_away_states; | 3971 ret->away_states = jabber_away_states; |
3990 ret->actions = jabber_actions; | 3972 ret->actions = jabber_actions; |
3991 ret->do_action = jabber_do_action; | 3973 ret->do_action = jabber_do_action; |
3992 ret->buddy_menu = jabber_buddy_menu; | 3974 ret->buddy_menu = jabber_buddy_menu; |
3993 ret->edit_buddy_menu = jabber_edit_buddy_menu; | 3975 ret->edit_buddy_menu = jabber_edit_buddy_menu; |
3994 ret->user_opts = jabber_user_opts; | |
3995 ret->login = jabber_login; | 3976 ret->login = jabber_login; |
3996 ret->close = jabber_close; | 3977 ret->close = jabber_close; |
3997 ret->send_im = jabber_send_im; | 3978 ret->send_im = jabber_send_im; |
3998 ret->set_info = jabber_set_info; | 3979 ret->set_info = jabber_set_info; |
3999 ret->get_info = jabber_get_info; | 3980 ret->get_info = jabber_get_info; |
4026 ret->alias_buddy = jabber_alias_buddy; | 4007 ret->alias_buddy = jabber_alias_buddy; |
4027 ret->group_buddy = jabber_group_change; | 4008 ret->group_buddy = jabber_group_change; |
4028 ret->send_typing = jabber_send_typing; | 4009 ret->send_typing = jabber_send_typing; |
4029 ret->convo_closed = jabber_convo_closed; | 4010 ret->convo_closed = jabber_convo_closed; |
4030 ret->rename_group = jabber_rename_group; | 4011 ret->rename_group = jabber_rename_group; |
4012 | |
4013 puo = g_new0(struct proto_user_opt, 1); | |
4014 puo->label = g_strdup("Port:"); | |
4015 puo->def = g_strdup("5222"); | |
4016 puo->pos = USEROPT_PORT; | |
4017 ret->user_opts = g_list_append(ret->user_opts, puo); | |
4031 | 4018 |
4032 my_protocol = ret; | 4019 my_protocol = ret; |
4033 } | 4020 } |
4034 | 4021 |
4035 #ifndef STATIC | 4022 #ifndef STATIC |
4036 | 4023 |
4037 char *gaim_plugin_init(GModule *handle) | 4024 void *gaim_prpl_init(struct prpl *prpl) |
4038 { | 4025 { |
4039 load_protocol(jabber_init, sizeof(struct prpl)); | 4026 jabber_init(prpl); |
4040 return NULL; | 4027 prpl->plug->desc.api_version = PLUGIN_API_VERSION; |
4041 } | |
4042 | |
4043 void gaim_plugin_remove() | |
4044 { | |
4045 struct prpl *p = find_prpl(PROTO_JABBER); | |
4046 if (p == my_protocol) | |
4047 unload_protocol(p); | |
4048 } | |
4049 | |
4050 char *name() | |
4051 { | |
4052 return "Jabber"; | |
4053 } | |
4054 | |
4055 char *description() | |
4056 { | |
4057 return PRPL_DESC("Jabber"); | |
4058 } | 4028 } |
4059 | 4029 |
4060 #endif | 4030 #endif |
4061 | 4031 |
4062 /* | 4032 /* |