libpurple/protocols/irc/irc.c

branch
soc.2013.gobjectification.plugins
changeset 36677
081733748bbc
parent 36663
c61b6dbc1f03
child 36678
ed9d10d8e45a
equal deleted inserted replaced
36676:214b4782e5da 36677:081733748bbc
968 option = purple_account_option_bool_new( 968 option = purple_account_option_bool_new(
969 _("Allow plaintext SASL auth over unencrypted connection"), 969 _("Allow plaintext SASL auth over unencrypted connection"),
970 "auth_plain_in_clear", FALSE); 970 "auth_plain_in_clear", FALSE);
971 proto_class->protocol_options = g_list_append(proto_class->protocol_options, option); 971 proto_class->protocol_options = g_list_append(proto_class->protocol_options, option);
972 #endif 972 #endif
973
974 purple_prefs_remove("/protocols/irc/quitmsg");
975 purple_prefs_remove("/protocols/irc");
976
977 irc_register_commands();
978 }
979
980 static void irc_protocol_base_finalize(IRCProtocolClass *klass)
981 {
982 irc_unregister_commands();
983 } 973 }
984 974
985 static void 975 static void
986 irc_protocol_interface_init(PurpleProtocolInterface *iface) 976 irc_protocol_interface_init(PurpleProtocolInterface *iface)
987 { 977 {
1011 iface->new_xfer = irc_dccsend_new_xfer; 1001 iface->new_xfer = irc_dccsend_new_xfer;
1012 iface->send_raw = irc_send_raw; 1002 iface->send_raw = irc_send_raw;
1013 iface->get_max_message_size = irc_get_max_message_size; 1003 iface->get_max_message_size = irc_get_max_message_size;
1014 } 1004 }
1015 1005
1006 static void irc_protocol_base_finalize(IRCProtocolClass *klass) { }
1007
1016 static PurplePluginInfo * 1008 static PurplePluginInfo *
1017 plugin_query(GError **error) 1009 plugin_query(GError **error)
1018 { 1010 {
1019 return purple_plugin_info_new( 1011 return purple_plugin_info_new(
1020 "id", "protocol-irc", 1012 "id", "protocol-irc",
1036 { 1028 {
1037 _irc_protocol = purple_protocols_add(IRC_TYPE_PROTOCOL, error); 1029 _irc_protocol = purple_protocols_add(IRC_TYPE_PROTOCOL, error);
1038 if (!_irc_protocol) 1030 if (!_irc_protocol)
1039 return FALSE; 1031 return FALSE;
1040 1032
1033 purple_prefs_remove("/protocols/irc/quitmsg");
1034 purple_prefs_remove("/protocols/irc");
1035
1036 irc_register_commands();
1037
1041 purple_signal_register(_irc_protocol, "irc-sending-text", 1038 purple_signal_register(_irc_protocol, "irc-sending-text",
1042 purple_marshal_VOID__POINTER_POINTER, G_TYPE_NONE, 2, 1039 purple_marshal_VOID__POINTER_POINTER, G_TYPE_NONE, 2,
1043 PURPLE_TYPE_CONNECTION, 1040 PURPLE_TYPE_CONNECTION,
1044 G_TYPE_POINTER); /* pointer to a string */ 1041 G_TYPE_POINTER); /* pointer to a string */
1045 purple_signal_register(_irc_protocol, "irc-receiving-text", 1042 purple_signal_register(_irc_protocol, "irc-receiving-text",
1051 } 1048 }
1052 1049
1053 static gboolean 1050 static gboolean
1054 plugin_unload(PurplePlugin *plugin, GError **error) 1051 plugin_unload(PurplePlugin *plugin, GError **error)
1055 { 1052 {
1053 irc_unregister_commands();
1054
1056 if (!purple_protocols_remove(_irc_protocol, error)) 1055 if (!purple_protocols_remove(_irc_protocol, error))
1057 return FALSE; 1056 return FALSE;
1058 1057
1059 return TRUE; 1058 return TRUE;
1060 } 1059 }

mercurial