Mercurial > pidgin
comparison plugins/irc.c @ 1047:ece2d1543b20
[gaim-migrate @ 1057]
Plugins now use GModule. Protocol plugins can be dynamically updated.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Wed, 01 Nov 2000 22:30:36 +0000 |
parents | 4593605da0e2 |
children | 49799527aebf |
comparison
equal
deleted
inserted
replaced
1046:4593605da0e2 | 1047:ece2d1543b20 |
---|---|
890 | 890 |
891 /* But first, let's go ahead and check our list */ | 891 /* But first, let's go ahead and check our list */ |
892 irc_request_buddy_update(gc); | 892 irc_request_buddy_update(gc); |
893 } | 893 } |
894 | 894 |
895 struct prpl *irc_init() { | 895 static struct prpl *my_protocol = NULL; |
896 struct prpl *ret = g_new0(struct prpl, 1); | 896 |
897 | 897 void irc_init(struct prpl *ret) { |
898 ret->protocol = PROTO_IRC; | 898 ret->protocol = PROTO_IRC; |
899 ret->name = irc_name; | 899 ret->name = irc_name; |
900 ret->login = irc_login; | 900 ret->login = irc_login; |
901 ret->close = irc_close; | 901 ret->close = irc_close; |
902 ret->send_im = irc_send_im; | 902 ret->send_im = irc_send_im; |
920 ret->chat_invite = NULL; | 920 ret->chat_invite = NULL; |
921 ret->chat_leave = irc_chat_leave; | 921 ret->chat_leave = irc_chat_leave; |
922 ret->chat_whisper = NULL; | 922 ret->chat_whisper = NULL; |
923 ret->chat_send = irc_chat_send; | 923 ret->chat_send = irc_chat_send; |
924 ret->keepalive = NULL; | 924 ret->keepalive = NULL; |
925 | 925 |
926 return ret; | 926 my_protocol = ret; |
927 } | 927 } |
928 | 928 |
929 int gaim_plugin_init(void *handle) { | 929 char *gaim_plugin_init(GModule *handle) { |
930 load_protocl(irc_init); | 930 load_protocol(irc_init); |
931 return 0; | 931 return NULL; |
932 } | 932 } |
933 | |
934 void gaim_plugin_remove() { | |
935 struct prpl *p = find_prpl(PROTO_IRC); | |
936 if (p == my_protocol) | |
937 unload_protocol(p); | |
938 } |