| 1036 status[0] ? status : NULL, TRUE); |
1036 status[0] ? status : NULL, TRUE); |
| 1037 purple_request_field_group_add_field(g, f); |
1037 purple_request_field_group_add_field(g, f); |
| 1038 purple_request_fields_add_group(fields, g); |
1038 purple_request_fields_add_group(fields, g); |
| 1039 |
1039 |
| 1040 g = purple_request_field_group_new(NULL); |
1040 g = purple_request_field_group_new(NULL); |
| 1041 #if 0 |
|
| 1042 f = purple_request_field_label_new("l2", _("Online Services")); |
|
| 1043 purple_request_field_group_add_field(g, f); |
|
| 1044 f = purple_request_field_bool_new("services", |
|
| 1045 _("Let others see what services you are using"), |
|
| 1046 TRUE); |
|
| 1047 purple_request_field_group_add_field(g, f); |
|
| 1048 #endif |
|
| 1049 #ifdef HAVE_SYS_UTSNAME_H |
1041 #ifdef HAVE_SYS_UTSNAME_H |
| 1050 f = purple_request_field_bool_new("device", |
1042 f = purple_request_field_bool_new("device", |
| 1051 _("Let others see what computer you are using"), |
1043 _("Let others see what computer you are using"), |
| 1052 device); |
1044 device); |
| 1053 purple_request_field_group_add_field(g, f); |
1045 purple_request_field_group_add_field(g, f); |
| 2089 id = purple_cmd_register("ping", "", PURPLE_CMD_P_PROTOCOL, |
2081 id = purple_cmd_register("ping", "", PURPLE_CMD_P_PROTOCOL, |
| 2090 PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PROTOCOL_ONLY, |
2082 PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PROTOCOL_ONLY, |
| 2091 "prpl-silc", silcpurple_cmd_generic, |
2083 "prpl-silc", silcpurple_cmd_generic, |
| 2092 _("ping: Send PING to the connected server"), NULL); |
2084 _("ping: Send PING to the connected server"), NULL); |
| 2093 cmds = g_slist_prepend(cmds, GUINT_TO_POINTER(id)); |
2085 cmds = g_slist_prepend(cmds, GUINT_TO_POINTER(id)); |
| 2094 |
|
| 2095 #if 0 /* Purple doesn't handle these yet */ |
|
| 2096 id = purple_cmd_register("users", "w", PURPLE_CMD_P_PROTOCOL, |
|
| 2097 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PROTOCOL_ONLY, |
|
| 2098 "prpl-silc", silcpurple_cmd_users, |
|
| 2099 _("users <channel>: List users in channel")); |
|
| 2100 cmds = g_slist_prepend(cmds, GUINT_TO_POINTER(id)); |
|
| 2101 |
|
| 2102 id = purple_cmd_register("names", "ww", PURPLE_CMD_P_PROTOCOL, |
|
| 2103 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PROTOCOL_ONLY | |
|
| 2104 PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-silc", silcpurple_cmd_names, |
|
| 2105 _("names [-count|-ops|-halfops|-voices|-normal] <channel(s)>: List specific users in channel(s)")); |
|
| 2106 cmds = g_slist_prepend(cmds, GUINT_TO_POINTER(id)); |
|
| 2107 #endif |
|
| 2108 } |
2086 } |
| 2109 |
2087 |
| 2110 static void |
2088 static void |
| 2111 silcpurple_unregister_commands(void) |
2089 silcpurple_unregister_commands(void) |
| 2112 { |
2090 { |
| 2133 NULL, |
2111 NULL, |
| 2134 NULL, |
2112 NULL, |
| 2135 NULL |
2113 NULL |
| 2136 }; |
2114 }; |
| 2137 |
2115 |
| 2138 #if 0 |
|
| 2139 static SilcBool silcpurple_debug_cb(char *file, char *function, int line, |
|
| 2140 char *message, void *context) |
|
| 2141 { |
|
| 2142 purple_debug_info("SILC", "%s:%d:%s - %s\n", file ? file : "(null)", line, function ? function : "(null)", message ? message : "(null)"); |
|
| 2143 return TRUE; |
|
| 2144 } |
|
| 2145 #endif |
|
| 2146 |
2116 |
| 2147 static void |
2117 static void |
| 2148 silcpurple_protocol_init(PurpleProtocol *protocol) |
2118 silcpurple_protocol_init(PurpleProtocol *protocol) |
| 2149 { |
2119 { |
| 2150 PurpleAccountOption *option; |
2120 PurpleAccountOption *option; |
| 2347 purple_prefs_remove("/plugins/prpl/silc"); |
2317 purple_prefs_remove("/plugins/prpl/silc"); |
| 2348 |
2318 |
| 2349 silc_log_set_callback(SILC_LOG_ERROR, silcpurple_log_error, NULL); |
2319 silc_log_set_callback(SILC_LOG_ERROR, silcpurple_log_error, NULL); |
| 2350 silcpurple_register_commands(); |
2320 silcpurple_register_commands(); |
| 2351 |
2321 |
| 2352 #if 0 |
|
| 2353 silc_log_debug(TRUE); |
|
| 2354 silc_log_set_debug_string("*client*"); |
|
| 2355 silc_log_quick(TRUE); |
|
| 2356 silc_log_set_debug_callbacks(silcpurple_debug_cb, NULL, NULL, NULL); |
|
| 2357 #endif |
|
| 2358 |
|
| 2359 return TRUE; |
2322 return TRUE; |
| 2360 } |
2323 } |
| 2361 |
2324 |
| 2362 static gboolean |
2325 static gboolean |
| 2363 plugin_unload(PurplePlugin *plugin, GError **error) |
2326 plugin_unload(PurplePlugin *plugin, GError **error) |