MCPcopy Create free account
hub / github.com/annmuor/jnode / list

Method list

jnode-core/src/jnode/robot/AreaFix.java:198–239  ·  view source on GitHub ↗

Отправляем %LIST @param link @return @throws SQLException

(Link link)

Source from the content-addressed store, hash-verified

196 * @throws SQLException
197 */
198 private String list(Link link) throws SQLException {
199 StringBuilder sb = new StringBuilder();
200 sb.append("Legend: * - subscribed\n\n========== List of echoareas ==========\n");
201 String[] groups = FtnTools.getOptionStringArray(link,
202 LinkOption.SARRAY_LINK_GROUPS);
203 List<Echoarea> areas = ORMManager.get(Echoarea.class).getOrderAnd(
204 "name", true);
205 for (Echoarea area : areas) {
206 boolean denied = true;
207 if (!"".equals(area.getGroup())) {
208 for (String group : groups) {
209 if (area.getGroup().equals(group)) {
210 denied = false;
211 break;
212 }
213 }
214 } else {
215 denied = false;
216 }
217 if (denied) {
218 continue;
219 }
220 Subscription sub = ORMManager.get(Subscription.class).getFirstAnd(
221 "echoarea_id", "=", area.getId(), "link_id", "=",
222 link.getId());
223
224 if (sub != null) {
225 sb.append("* ");
226 } else {
227 sb.append(" ");
228 }
229 sb.append(area.getName());
230 if (area.getDescription().length() > 0) {
231 sb.append(" - ");
232 sb.append(area.getDescription());
233 }
234 sb.append('\n');
235 }
236 sb.append("========== List of echoareas ==========\n");
237 return sb.toString();
238
239 }
240
241 /**
242 * Отправляем %QUERY

Callers 1

executeMethod · 0.95

Calls 11

getOptionStringArrayMethod · 0.95
getMethod · 0.95
appendMethod · 0.80
getOrderAndMethod · 0.80
getFirstAndMethod · 0.80
getIdMethod · 0.65
equalsMethod · 0.45
getGroupMethod · 0.45
getNameMethod · 0.45
getDescriptionMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected