| 913 struct irc_conn *irc = purple_connection_get_protocol_data(gc); |
913 struct irc_conn *irc = purple_connection_get_protocol_data(gc); |
| 914 if ((time(NULL) - irc->recv_time) > PING_TIMEOUT) |
914 if ((time(NULL) - irc->recv_time) > PING_TIMEOUT) |
| 915 irc_cmd_ping(irc, NULL, NULL, NULL); |
915 irc_cmd_ping(irc, NULL, NULL, NULL); |
| 916 } |
916 } |
| 917 |
917 |
| 918 static PurplePluginProtocolInfo prpl_info = |
918 static PurpleProtocol protocol = |
| 919 { |
919 { |
| 920 "prpl-irc", /* id */ |
920 "prpl-irc", /* id */ |
| 921 "IRC", /* name */ |
921 "IRC", /* name */ |
| 922 sizeof(PurplePluginProtocolInfo), /* struct_size */ |
922 sizeof(PurpleProtocol), /* struct_size */ |
| 923 OPT_PROTO_CHAT_TOPIC | OPT_PROTO_PASSWORD_OPTIONAL | |
923 OPT_PROTO_CHAT_TOPIC | OPT_PROTO_PASSWORD_OPTIONAL | |
| 924 OPT_PROTO_SLASH_COMMANDS_NATIVE, |
924 OPT_PROTO_SLASH_COMMANDS_NATIVE, |
| 925 NULL, /* user_splits */ |
925 NULL, /* user_splits */ |
| 926 NULL, /* protocol_options */ |
926 NULL, /* protocol_options */ |
| 927 NO_BUDDY_ICONS, /* icon_spec */ |
927 NO_BUDDY_ICONS, /* icon_spec */ |
| 1017 { |
1017 { |
| 1018 PurpleAccountUserSplit *split; |
1018 PurpleAccountUserSplit *split; |
| 1019 PurpleAccountOption *option; |
1019 PurpleAccountOption *option; |
| 1020 |
1020 |
| 1021 split = purple_account_user_split_new(_("Server"), IRC_DEFAULT_SERVER, '@'); |
1021 split = purple_account_user_split_new(_("Server"), IRC_DEFAULT_SERVER, '@'); |
| 1022 prpl_info.user_splits = g_list_append(prpl_info.user_splits, split); |
1022 protocol.user_splits = g_list_append(protocol.user_splits, split); |
| 1023 |
1023 |
| 1024 option = purple_account_option_int_new(_("Port"), "port", IRC_DEFAULT_PORT); |
1024 option = purple_account_option_int_new(_("Port"), "port", IRC_DEFAULT_PORT); |
| 1025 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |
1025 protocol.protocol_options = g_list_append(protocol.protocol_options, option); |
| 1026 |
1026 |
| 1027 option = purple_account_option_string_new(_("Encodings"), "encoding", IRC_DEFAULT_CHARSET); |
1027 option = purple_account_option_string_new(_("Encodings"), "encoding", IRC_DEFAULT_CHARSET); |
| 1028 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |
1028 protocol.protocol_options = g_list_append(protocol.protocol_options, option); |
| 1029 |
1029 |
| 1030 option = purple_account_option_bool_new(_("Auto-detect incoming UTF-8"), "autodetect_utf8", IRC_DEFAULT_AUTODETECT); |
1030 option = purple_account_option_bool_new(_("Auto-detect incoming UTF-8"), "autodetect_utf8", IRC_DEFAULT_AUTODETECT); |
| 1031 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |
1031 protocol.protocol_options = g_list_append(protocol.protocol_options, option); |
| 1032 |
1032 |
| 1033 option = purple_account_option_string_new(_("Username"), "username", ""); |
1033 option = purple_account_option_string_new(_("Username"), "username", ""); |
| 1034 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |
1034 protocol.protocol_options = g_list_append(protocol.protocol_options, option); |
| 1035 |
1035 |
| 1036 option = purple_account_option_string_new(_("Real name"), "realname", ""); |
1036 option = purple_account_option_string_new(_("Real name"), "realname", ""); |
| 1037 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |
1037 protocol.protocol_options = g_list_append(protocol.protocol_options, option); |
| 1038 |
1038 |
| 1039 /* |
1039 /* |
| 1040 option = purple_account_option_string_new(_("Quit message"), "quitmsg", IRC_DEFAULT_QUIT); |
1040 option = purple_account_option_string_new(_("Quit message"), "quitmsg", IRC_DEFAULT_QUIT); |
| 1041 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |
1041 protocol.protocol_options = g_list_append(protocol.protocol_options, option); |
| 1042 */ |
1042 */ |
| 1043 |
1043 |
| 1044 option = purple_account_option_bool_new(_("Use SSL"), "ssl", FALSE); |
1044 option = purple_account_option_bool_new(_("Use SSL"), "ssl", FALSE); |
| 1045 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |
1045 protocol.protocol_options = g_list_append(protocol.protocol_options, option); |
| 1046 |
1046 |
| 1047 #ifdef HAVE_CYRUS_SASL |
1047 #ifdef HAVE_CYRUS_SASL |
| 1048 option = purple_account_option_bool_new(_("Authenticate with SASL"), "sasl", FALSE); |
1048 option = purple_account_option_bool_new(_("Authenticate with SASL"), "sasl", FALSE); |
| 1049 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |
1049 protocol.protocol_options = g_list_append(protocol.protocol_options, option); |
| 1050 |
1050 |
| 1051 option = purple_account_option_bool_new( |
1051 option = purple_account_option_bool_new( |
| 1052 _("Allow plaintext SASL auth over unencrypted connection"), |
1052 _("Allow plaintext SASL auth over unencrypted connection"), |
| 1053 "auth_plain_in_clear", FALSE); |
1053 "auth_plain_in_clear", FALSE); |
| 1054 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |
1054 protocol.protocol_options = g_list_append(protocol.protocol_options, option); |
| 1055 #endif |
1055 #endif |
| 1056 |
1056 |
| 1057 _irc_protocol = &prpl_info; |
1057 _irc_protocol = &protocol; |
| 1058 |
1058 |
| 1059 purple_prefs_remove("/plugins/prpl/irc/quitmsg"); |
1059 purple_prefs_remove("/plugins/prpl/irc/quitmsg"); |
| 1060 purple_prefs_remove("/plugins/prpl/irc"); |
1060 purple_prefs_remove("/plugins/prpl/irc"); |
| 1061 |
1061 |
| 1062 irc_register_commands(); |
1062 irc_register_commands(); |