Mercurial > pidgin.yaz
comparison src/protocols/oscar/oscar.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 | 5a4569cea6be |
children | 2b43124e8475 |
comparison
equal
deleted
inserted
replaced
3571:a88c62c5b7da | 3572:bdd0bebd2d04 |
---|---|
2721 static void oscar_keepalive(struct gaim_connection *gc) { | 2721 static void oscar_keepalive(struct gaim_connection *gc) { |
2722 struct oscar_data *odata = (struct oscar_data *)gc->proto_data; | 2722 struct oscar_data *odata = (struct oscar_data *)gc->proto_data; |
2723 aim_flap_nop(odata->sess, odata->conn); | 2723 aim_flap_nop(odata->sess, odata->conn); |
2724 } | 2724 } |
2725 | 2725 |
2726 static char *oscar_name() { | |
2727 return "AIM / ICQ"; | |
2728 } | |
2729 | |
2730 static int oscar_send_typing(struct gaim_connection *gc, char *name, int typing) { | 2726 static int oscar_send_typing(struct gaim_connection *gc, char *name, int typing) { |
2731 struct oscar_data *odata = (struct oscar_data *)gc->proto_data; | 2727 struct oscar_data *odata = (struct oscar_data *)gc->proto_data; |
2732 struct direct_im *dim = find_direct_im(odata, name); | 2728 struct direct_im *dim = find_direct_im(odata, name); |
2733 if (!dim) | 2729 if (!dim) |
2734 return 0; | 2730 return 0; |
3741 } | 3737 } |
3742 | 3738 |
3743 return m; | 3739 return m; |
3744 } | 3740 } |
3745 | 3741 |
3746 static GList *oscar_user_opts() | |
3747 { | |
3748 GList *m = NULL; | |
3749 struct proto_user_opt *puo; | |
3750 | |
3751 puo = g_new0(struct proto_user_opt, 1); | |
3752 puo->label = "Auth Host:"; | |
3753 puo->def = "login.oscar.aol.com"; | |
3754 puo->pos = USEROPT_AUTH; | |
3755 m = g_list_append(m, puo); | |
3756 | |
3757 puo = g_new0(struct proto_user_opt, 1); | |
3758 puo->label = "Auth Port:"; | |
3759 puo->def = "5190"; | |
3760 puo->pos = USEROPT_AUTHPORT; | |
3761 m = g_list_append(m, puo); | |
3762 | |
3763 return m; | |
3764 } | |
3765 | |
3766 static void oscar_set_permit_deny(struct gaim_connection *gc) { | 3742 static void oscar_set_permit_deny(struct gaim_connection *gc) { |
3767 struct oscar_data *od = (struct oscar_data *)gc->proto_data; | 3743 struct oscar_data *od = (struct oscar_data *)gc->proto_data; |
3768 if (od->icq) { | 3744 if (od->icq) { |
3769 GSList *list; | 3745 GSList *list; |
3770 char buf[MAXMSGLEN]; | 3746 char buf[MAXMSGLEN]; |
3981 | 3957 |
3982 | 3958 |
3983 static struct prpl *my_protocol = NULL; | 3959 static struct prpl *my_protocol = NULL; |
3984 | 3960 |
3985 void oscar_init(struct prpl *ret) { | 3961 void oscar_init(struct prpl *ret) { |
3962 struct proto_user_opt *puo; | |
3986 ret->protocol = PROTO_OSCAR; | 3963 ret->protocol = PROTO_OSCAR; |
3987 ret->options = OPT_PROTO_BUDDY_ICON | OPT_PROTO_IM_IMAGE; | 3964 ret->options = OPT_PROTO_BUDDY_ICON | OPT_PROTO_IM_IMAGE; |
3988 ret->name = oscar_name; | 3965 ret->name = g_strdup("Oscar"); |
3989 ret->list_icon = oscar_list_icon; | 3966 ret->list_icon = oscar_list_icon; |
3990 ret->away_states = oscar_away_states; | 3967 ret->away_states = oscar_away_states; |
3991 ret->actions = oscar_actions; | 3968 ret->actions = oscar_actions; |
3992 ret->do_action = oscar_do_action; | 3969 ret->do_action = oscar_do_action; |
3993 ret->buddy_menu = oscar_buddy_menu; | 3970 ret->buddy_menu = oscar_buddy_menu; |
3994 ret->edit_buddy_menu = oscar_edit_buddy_menu; | 3971 ret->edit_buddy_menu = oscar_edit_buddy_menu; |
3995 ret->user_opts = oscar_user_opts; | |
3996 ret->login = oscar_login; | 3972 ret->login = oscar_login; |
3997 ret->close = oscar_close; | 3973 ret->close = oscar_close; |
3998 ret->send_im = oscar_send_im; | 3974 ret->send_im = oscar_send_im; |
3999 ret->send_typing = oscar_send_typing; | 3975 ret->send_typing = oscar_send_typing; |
4000 ret->set_info = oscar_set_info; | 3976 ret->set_info = oscar_set_info; |
4025 ret->chat_whisper = NULL; | 4001 ret->chat_whisper = NULL; |
4026 ret->chat_send = oscar_chat_send; | 4002 ret->chat_send = oscar_chat_send; |
4027 ret->keepalive = oscar_keepalive; | 4003 ret->keepalive = oscar_keepalive; |
4028 ret->convo_closed = oscar_convo_closed; | 4004 ret->convo_closed = oscar_convo_closed; |
4029 | 4005 |
4006 puo = g_new0(struct proto_user_opt, 1); | |
4007 puo->label = g_strdup("Auth Host:"); | |
4008 puo->def = g_strdup("login.oscar.aol.com"); | |
4009 puo->pos = USEROPT_AUTH; | |
4010 ret->user_opts = g_list_append(ret->user_opts, puo); | |
4011 | |
4012 puo = g_new0(struct proto_user_opt, 1); | |
4013 puo->label = g_strdup("Auth Port:"); | |
4014 puo->def = g_strdup("5190"); | |
4015 puo->pos = USEROPT_AUTHPORT; | |
4016 ret->user_opts = g_list_append(ret->user_opts, puo); | |
4017 | |
4030 my_protocol = ret; | 4018 my_protocol = ret; |
4031 } | 4019 } |
4032 | 4020 |
4033 #ifndef STATIC | 4021 #ifndef STATIC |
4034 | 4022 |
4035 char *gaim_plugin_init(GModule *handle) | 4023 void *gaim_prpl_init(struct prpl *prpl) |
4036 { | 4024 { |
4037 load_protocol(oscar_init, sizeof(struct prpl)); | 4025 oscar_init(prpl); |
4038 return NULL; | 4026 prpl->plug->desc.api_version = PLUGIN_API_VERSION; |
4039 } | |
4040 | |
4041 void gaim_plugin_remove() | |
4042 { | |
4043 struct prpl *p = find_prpl(PROTO_OSCAR); | |
4044 if (p == my_protocol) | |
4045 unload_protocol(p); | |
4046 } | |
4047 | |
4048 char *name() | |
4049 { | |
4050 return "Oscar"; | |
4051 } | |
4052 | |
4053 char *description() | |
4054 { | |
4055 return PRPL_DESC("Oscar"); | |
4056 } | 4027 } |
4057 | 4028 |
4058 #endif | 4029 #endif |