| 40944:6e95a22ee02f | 40945:bbeb2e98ea5b |
|---|---|
| 23 | 23 |
| 24 #include <errno.h> | 24 #include <errno.h> |
| 25 | 25 |
| 26 #include <glib/gi18n-lib.h> | 26 #include <glib/gi18n-lib.h> |
| 27 | 27 |
| 28 #include <gplugin.h> | |
| 29 #include <gplugin-native.h> | |
| 30 | |
| 28 #include <purple.h> | 31 #include <purple.h> |
| 29 | 32 |
| 30 #include "irc.h" | 33 #include "irc.h" |
| 31 | 34 |
| 32 #define PING_TIMEOUT 60 | 35 #define PING_TIMEOUT 60 |
| 1135 "options", OPT_PROTO_CHAT_TOPIC | OPT_PROTO_PASSWORD_OPTIONAL | | 1138 "options", OPT_PROTO_CHAT_TOPIC | OPT_PROTO_PASSWORD_OPTIONAL | |
| 1136 OPT_PROTO_SLASH_COMMANDS_NATIVE, | 1139 OPT_PROTO_SLASH_COMMANDS_NATIVE, |
| 1137 NULL)); | 1140 NULL)); |
| 1138 } | 1141 } |
| 1139 | 1142 |
| 1140 static PurplePluginInfo * | 1143 static GPluginPluginInfo * |
| 1141 plugin_query(GError **error) | 1144 irc_query(GError **error) |
| 1142 { | 1145 { |
| 1143 return purple_plugin_info_new( | 1146 return purple_plugin_info_new( |
| 1144 "id", "prpl-irc", | 1147 "id", "prpl-irc", |
| 1145 "name", "IRC Protocol", | 1148 "name", "IRC Protocol", |
| 1146 "version", DISPLAY_VERSION, | 1149 "version", DISPLAY_VERSION, |
| 1154 NULL | 1157 NULL |
| 1155 ); | 1158 ); |
| 1156 } | 1159 } |
| 1157 | 1160 |
| 1158 static gboolean | 1161 static gboolean |
| 1159 plugin_load(PurplePlugin *plugin, GError **error) | 1162 irc_load(GPluginPlugin *plugin, GError **error) |
| 1160 { | 1163 { |
| 1161 PurpleProtocolManager *manager = purple_protocol_manager_get_default(); | 1164 PurpleProtocolManager *manager = purple_protocol_manager_get_default(); |
| 1162 | 1165 |
| 1163 irc_protocol_register_type(G_TYPE_MODULE(plugin)); | 1166 irc_protocol_register_type(G_TYPE_MODULE(plugin)); |
| 1164 | 1167 |
| 1190 | 1193 |
| 1191 return TRUE; | 1194 return TRUE; |
| 1192 } | 1195 } |
| 1193 | 1196 |
| 1194 static gboolean | 1197 static gboolean |
| 1195 plugin_unload(PurplePlugin *plugin, GError **error) | 1198 irc_unload(GPluginPlugin *plugin, GError **error) |
| 1196 { | 1199 { |
| 1197 PurpleProtocolManager *manager = purple_protocol_manager_get_default(); | 1200 PurpleProtocolManager *manager = purple_protocol_manager_get_default(); |
| 1198 | 1201 |
| 1199 if(!purple_protocol_manager_unregister(manager, _irc_protocol, error)) { | 1202 if(!purple_protocol_manager_unregister(manager, _irc_protocol, error)) { |
| 1200 return FALSE; | 1203 return FALSE; |
| 1208 g_clear_object(&_irc_protocol); | 1211 g_clear_object(&_irc_protocol); |
| 1209 | 1212 |
| 1210 return TRUE; | 1213 return TRUE; |
| 1211 } | 1214 } |
| 1212 | 1215 |
| 1213 PURPLE_PLUGIN_INIT(irc, plugin_query, plugin_load, plugin_unload); | 1216 GPLUGIN_NATIVE_PLUGIN_DECLARE(irc) |