Changes in root_commands.c [5a8afc3:4a9c6b0]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
root_commands.c
r5a8afc3 r4a9c6b0 1064 1064 format = "%s\t%s\t%s"; 1065 1065 } else { 1066 format = "%- 16.16s %-40.40s %s";1066 format = "%-24.24s %-40.40s %s"; 1067 1067 } 1068 1068 … … 1164 1164 } 1165 1165 1166 static void cmd_plugins_info(irc_t *irc, char **cmd) 1167 { 1168 GList *l; 1169 struct plugin_info *info; 1170 1171 MIN_ARGS(2); 1172 1173 for (l = get_plugins(); l; l = l->next) { 1174 info = l->data; 1175 if (g_strcasecmp(cmd[2], info->name) == 0) { 1176 break; 1177 } 1178 } 1179 1180 if (!l) { 1181 return; 1182 } 1183 1184 irc_rootmsg(irc, "%s:", info->name); 1185 irc_rootmsg(irc, " Version: %s", info->version); 1186 1187 if (info->description) { 1188 irc_rootmsg(irc, " Description: %s", info->description); 1189 } 1190 1191 if (info->author) { 1192 irc_rootmsg(irc, " Author: %s", info->author); 1193 } 1194 1195 if (info->url) { 1196 irc_rootmsg(irc, " URL: %s", info->url); 1197 } 1198 } 1199 1166 1200 static void cmd_plugins(irc_t *irc, char **cmd) 1167 1201 { 1168 1202 GList *prpls; 1169 1203 GString *gstr; 1204 1205 if (cmd[1] && g_strcasecmp(cmd[1], "info") == 0) { 1206 cmd_plugins_info(irc, cmd); 1207 return; 1208 } 1170 1209 1171 1210 #ifdef WITH_PLUGINS 1172 1211 GList *l; 1173 1212 struct plugin_info *info; 1213 char *format; 1214 1215 if (strchr(irc->umode, 'b') != NULL) { 1216 format = "%s\t%s"; 1217 } else { 1218 format = "%-30s %s"; 1219 } 1220 1221 irc_rootmsg(irc, format, "Plugin", "Version"); 1174 1222 1175 1223 for (l = get_plugins(); l; l = l->next) { 1224 char *c; 1176 1225 info = l->data; 1177 irc_rootmsg(irc, "%s:", info->name); 1178 irc_rootmsg(irc, " Version: %s", info->version); 1179 1180 if (info->description) { 1181 irc_rootmsg(irc, " Description: %s", info->description); 1182 } 1183 1184 if (info->author) { 1185 irc_rootmsg(irc, " Author: %s", info->author); 1186 } 1187 1188 if (info->url) { 1189 irc_rootmsg(irc, " URL: %s", info->url); 1190 } 1191 1192 irc_rootmsg(irc, ""); 1226 1227 /* some purple plugins like to include several versions separated by newlines... */ 1228 if ((c = strchr(info->version, '\n'))) { 1229 char *version = g_strndup(info->version, c - info->version); 1230 irc_rootmsg(irc, format, info->name, version); 1231 g_free(version); 1232 } else { 1233 irc_rootmsg(irc, format, info->name, info->version); 1234 } 1193 1235 } 1194 1236 #endif 1237 1238 irc_rootmsg(irc, ""); 1195 1239 1196 1240 gstr = g_string_new(NULL); … … 1338 1382 } else if (g_strcasecmp(cmd[1], "set") == 0 || 1339 1383 g_strcasecmp(cmd[1], "del") == 0) { 1340 irc_rootmsg(irc, 1341 "Warning: The \002chat\002 command was mostly replaced with the \002channel\002 command."); 1342 cmd_channel(irc, cmd); 1384 irc_rootmsg(irc, "Unknown command: chat %s. Did you mean \002channel %s\002?", cmd[1], cmd[1]); 1343 1385 } else { 1344 1386 irc_rootmsg(irc, … … 1398 1440 topic = ci->topic ? ci->topic : ""; 1399 1441 1400 padded = str_pad_and_truncate(ci->title , title_len, "[...]");1442 padded = str_pad_and_truncate(ci->title ? ci->title : "", title_len, "[...]"); 1401 1443 irc_rootmsg(irc, iformat, ++i, padded, topic); 1402 1444 g_free(padded);
Note: See TracChangeset
for help on using the changeset viewer.