Changeset 7a9d968 for root_commands.c
- Timestamp:
- 2018-03-10T11:30:39Z (6 years ago)
- Children:
- 5447c59
- Parents:
- 3f44e43 (diff), 4a9c6b0 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
root_commands.c
r3f44e43 r7a9d968 1072 1072 format = "%s\t%s\t%s"; 1073 1073 } else { 1074 format = "%- 16.16s %-40.40s %s";1074 format = "%-24.24s %-40.40s %s"; 1075 1075 } 1076 1076 … … 1172 1172 } 1173 1173 1174 static void cmd_plugins_info(irc_t *irc, char **cmd) 1175 { 1176 GList *l; 1177 struct plugin_info *info; 1178 1179 MIN_ARGS(2); 1180 1181 for (l = get_plugins(); l; l = l->next) { 1182 info = l->data; 1183 if (g_strcasecmp(cmd[2], info->name) == 0) { 1184 break; 1185 } 1186 } 1187 1188 if (!l) { 1189 return; 1190 } 1191 1192 irc_rootmsg(irc, "%s:", info->name); 1193 irc_rootmsg(irc, " Version: %s", info->version); 1194 1195 if (info->description) { 1196 irc_rootmsg(irc, " Description: %s", info->description); 1197 } 1198 1199 if (info->author) { 1200 irc_rootmsg(irc, " Author: %s", info->author); 1201 } 1202 1203 if (info->url) { 1204 irc_rootmsg(irc, " URL: %s", info->url); 1205 } 1206 } 1207 1174 1208 static void cmd_plugins(irc_t *irc, char **cmd) 1175 1209 { 1176 1210 GList *prpls; 1177 1211 GString *gstr; 1212 1213 if (cmd[1] && g_strcasecmp(cmd[1], "info") == 0) { 1214 cmd_plugins_info(irc, cmd); 1215 return; 1216 } 1178 1217 1179 1218 #ifdef WITH_PLUGINS 1180 1219 GList *l; 1181 1220 struct plugin_info *info; 1221 char *format; 1222 1223 if (strchr(irc->umode, 'b') != NULL) { 1224 format = "%s\t%s"; 1225 } else { 1226 format = "%-30s %s"; 1227 } 1228 1229 irc_rootmsg(irc, format, "Plugin", "Version"); 1182 1230 1183 1231 for (l = get_plugins(); l; l = l->next) { 1232 char *c; 1184 1233 info = l->data; 1185 irc_rootmsg(irc, "%s:", info->name); 1186 irc_rootmsg(irc, " Version: %s", info->version); 1187 1188 if (info->description) { 1189 irc_rootmsg(irc, " Description: %s", info->description); 1190 } 1191 1192 if (info->author) { 1193 irc_rootmsg(irc, " Author: %s", info->author); 1194 } 1195 1196 if (info->url) { 1197 irc_rootmsg(irc, " URL: %s", info->url); 1198 } 1199 1200 irc_rootmsg(irc, ""); 1234 1235 /* some purple plugins like to include several versions separated by newlines... */ 1236 if ((c = strchr(info->version, '\n'))) { 1237 char *version = g_strndup(info->version, c - info->version); 1238 irc_rootmsg(irc, format, info->name, version); 1239 g_free(version); 1240 } else { 1241 irc_rootmsg(irc, format, info->name, info->version); 1242 } 1201 1243 } 1202 1244 #endif 1245 1246 irc_rootmsg(irc, ""); 1203 1247 1204 1248 gstr = g_string_new(NULL); … … 1346 1390 } else if (g_strcasecmp(cmd[1], "set") == 0 || 1347 1391 g_strcasecmp(cmd[1], "del") == 0) { 1348 irc_rootmsg(irc, 1349 "Warning: The \002chat\002 command was mostly replaced with the \002channel\002 command."); 1350 cmd_channel(irc, cmd); 1392 irc_rootmsg(irc, "Unknown command: chat %s. Did you mean \002channel %s\002?", cmd[1], cmd[1]); 1351 1393 } else { 1352 1394 irc_rootmsg(irc, … … 1406 1448 topic = ci->topic ? ci->topic : ""; 1407 1449 1408 padded = str_pad_and_truncate(ci->title , title_len, "[...]");1450 padded = str_pad_and_truncate(ci->title ? ci->title : "", title_len, "[...]"); 1409 1451 irc_rootmsg(irc, iformat, ++i, padded, topic); 1410 1452 g_free(padded);
Note: See TracChangeset
for help on using the changeset viewer.