(FtnMessage fmsg)
| 60 | "^%IGNOREPKTPWD (on|off)$", Pattern.CASE_INSENSITIVE); |
| 61 | |
| 62 | @Override |
| 63 | public void execute(FtnMessage fmsg) throws Exception { |
| 64 | Link link = getAndCheckLink(fmsg); |
| 65 | if (link == null) { |
| 66 | return; |
| 67 | } |
| 68 | |
| 69 | StringBuilder reply = new StringBuilder(); |
| 70 | for (String line : fmsg.getText().split("\n")) { |
| 71 | line = line.toLowerCase(); |
| 72 | if (HELP.matcher(line).matches()) { |
| 73 | FtnTools.writeReply(fmsg, |
| 74 | MessageFormat.format("{0} help", getRobotName()), |
| 75 | help()); |
| 76 | } else if (LIST.matcher(line).matches()) { |
| 77 | FtnTools.writeReply(fmsg, |
| 78 | MessageFormat.format("{0} list", getRobotName()), |
| 79 | list(link)); |
| 80 | } else if (QUERY.matcher(line).matches()) { |
| 81 | FtnTools.writeReply(fmsg, |
| 82 | MessageFormat.format("{0} query", getRobotName()), |
| 83 | query(link)); |
| 84 | } else { |
| 85 | Matcher m = REM.matcher(line); |
| 86 | if (m.matches()) { |
| 87 | String area = m.group(1); |
| 88 | reply.append(rem(link, area)); |
| 89 | continue; |
| 90 | } |
| 91 | m = ADD.matcher(line); |
| 92 | if (m.matches()) { |
| 93 | String area = m.group(1); |
| 94 | reply.append(add(link, area)); |
| 95 | continue; |
| 96 | } |
| 97 | m = RESCAN.matcher(line); |
| 98 | if (m.matches()) { |
| 99 | String area = m.group(1); |
| 100 | int num = Integer.valueOf(m.group(2)); |
| 101 | reply.append(rescan(link, area, num)); |
| 102 | continue; |
| 103 | } |
| 104 | m = ADD_RESCAN.matcher(line); |
| 105 | if (m.matches()) { |
| 106 | String area = m.group(1); |
| 107 | int num = Integer.valueOf(m.group(2)); |
| 108 | reply.append(add(link, area)); |
| 109 | reply.append(rescan(link, area, num)); |
| 110 | continue; |
| 111 | } |
| 112 | m = AFXPASS.matcher(line); |
| 113 | if (m.matches()) { |
| 114 | String newpwd = m.group(1); |
| 115 | reply.append(afxpass(link, newpwd)); |
| 116 | continue; |
| 117 | } |
| 118 | m = PKTPASS.matcher(line); |
| 119 | if (m.matches()) { |
nothing calls this directly
no test coverage detected