Changeset 808825e
- Timestamp:
- 2016-05-26T02:48:08Z (8 years ago)
- Branches:
- master
- Children:
- 35712b7
- Parents:
- d28fe1c4
- git-author:
- jgeboski <jgeboski@…> (15-05-16 20:40:15)
- git-committer:
- jgeboski <jgeboski@…> (26-05-16 02:48:08)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/user-guide/commands.xml
rd28fe1c4 r808825e 1836 1836 1837 1837 <bitlbee-command name="plugins"> 1838 <short-description>List all the external plugins </short-description>1838 <short-description>List all the external plugins and protocols</short-description> 1839 1839 <syntax>plugins</syntax> 1840 1840 1841 1841 <description> 1842 1842 <para> 1843 This gives you a list of all the external plugins .1843 This gives you a list of all the external plugins and protocols. 1844 1844 </para> 1845 1845 </description> -
protocols/nogaim.c
rd28fe1c4 r808825e 228 228 load_plugins(); 229 229 #endif 230 } 231 232 GList *get_protocols() 233 { 234 return protocols; 235 } 236 237 GList *get_protocols_disabled() 238 { 239 return disabled_protocols; 230 240 } 231 241 -
protocols/nogaim.h
rd28fe1c4 r808825e 287 287 /* im_api core stuff. */ 288 288 void nogaim_init(); 289 G_MODULE_EXPORT GList *get_protocols(); 290 G_MODULE_EXPORT GList *get_protocols_disabled(); 289 291 G_MODULE_EXPORT GSList *get_connections(); 290 292 G_MODULE_EXPORT struct prpl *find_protocol(const char *name); -
root_commands.c
rd28fe1c4 r808825e 1107 1107 } 1108 1108 1109 static gint prplcmp(gconstpointer a, gconstpointer b) 1110 { 1111 const struct prpl *pa = a; 1112 const struct prpl *pb = b; 1113 1114 return g_strcasecmp(pa->name, pb->name); 1115 } 1116 1117 static void prplstr(GList *prpls, GString *gstr) 1118 { 1119 const char *last = NULL; 1120 GList *l; 1121 struct prpl *p; 1122 1123 prpls = g_list_copy(prpls); 1124 prpls = g_list_sort(prpls, prplcmp); 1125 1126 for (l = prpls; l; l = l->next) { 1127 p = l->data; 1128 1129 if (last && g_strcasecmp(p->name, last) == 0) { 1130 /* Ignore duplicates (mainly for libpurple) */ 1131 continue; 1132 } 1133 1134 if (gstr->len != 0) { 1135 g_string_append(gstr, ", "); 1136 } 1137 1138 g_string_append(gstr, p->name); 1139 last = p->name; 1140 } 1141 1142 g_list_free(prpls); 1143 } 1144 1145 static void cmd_plugins(irc_t *irc, char **cmd) 1146 { 1147 GList *prpls; 1148 GString *gstr; 1149 1109 1150 #ifdef WITH_PLUGINS 1110 static void cmd_plugins(irc_t *irc, char **cmd)1111 {1112 1151 GList *l; 1113 1152 struct plugin_info *info; … … 1130 1169 } 1131 1170 1132 if (l->next) { 1133 irc_rootmsg(irc, ""); 1134 } 1135 } 1136 } 1171 irc_rootmsg(irc, ""); 1172 } 1137 1173 #endif 1174 1175 gstr = g_string_new(NULL); 1176 prpls = get_protocols(); 1177 1178 if (prpls) { 1179 prplstr(prpls, gstr); 1180 irc_rootmsg(irc, "Enabled Protocols: %s", gstr->str); 1181 g_string_truncate(gstr, 0); 1182 } 1183 1184 prpls = get_protocols_disabled(); 1185 1186 if (prpls) { 1187 prplstr(prpls, gstr); 1188 irc_rootmsg(irc, "Disabled Protocols: %s", gstr->str); 1189 } 1190 1191 g_string_free(gstr, TRUE); 1192 } 1138 1193 1139 1194 static void cmd_qlist(irc_t *irc, char **cmd) … … 1388 1443 { "nick", 1, cmd_nick, 0 }, 1389 1444 { "no", 0, cmd_yesno, 0 }, 1390 #ifdef WITH_PLUGINS1391 1445 { "plugins", 0, cmd_plugins, 0 }, 1392 #endif1393 1446 { "qlist", 0, cmd_qlist, 0 }, 1394 1447 { "register", 0, cmd_register, 0 },
Note: See TracChangeset
for help on using the changeset viewer.