63 |
|
String levelName = cp.getProperty(_name, "Alerter.IRC.level"); |
64 |
|
int level = StringUtils.getStringPos(levelName, Alert.alertLevels); |
65 |
|
// only send if it's equal (or above) our level |
66 |
< |
if(alert.getLevel() >= level) { |
66 |
> |
if(((alert.getLevel() == 0) && (alert.getLastLevel() >= level)) || (alert.getLevel() >= level)) { |
67 |
|
String alertType = Alert.alertLevels[alert.getLevel()]; |
68 |
|
String thresholdType = Alert.thresholdLevels[alert.getThreshold()]; |
69 |
|
// sort out the message |
255 |
|
*/ |
256 |
|
public void sendMsg(String msg) { |
257 |
|
_socketOut.println("PRIVMSG "+_channel+" :"+msg); |
258 |
+ |
// wait a second before returning... |
259 |
+ |
// this ensures messages can't be sent too fast |
260 |
+ |
try {Thread.sleep(1000);} catch (InterruptedException e) {} |
261 |
|
} |
262 |
|
|
263 |
|
/** |
268 |
|
*/ |
269 |
|
public void sendPrivMsg(String user, String msg) { |
270 |
|
_socketOut.println("PRIVMSG "+user+" :"+msg); |
271 |
+ |
// wait a second before returning... |
272 |
+ |
// this ensures messages can't be sent too fast |
273 |
+ |
try {Thread.sleep(1000);} catch (InterruptedException e) {} |
274 |
|
} |
275 |
|
|
276 |
|
/** |
281 |
|
public void sendAction(String msg) { |
282 |
|
char esc = 001; |
283 |
|
sendMsg(esc+"ACTION "+msg+esc); |
284 |
+ |
// wait a second before returning... |
285 |
+ |
// this ensures messages can't be sent too fast |
286 |
+ |
try {Thread.sleep(1000);} catch (InterruptedException e) {} |
287 |
|
} |
288 |
|
|
289 |
|
/** |
293 |
|
*/ |
294 |
|
public void sendNotice(String msg) { |
295 |
|
_socketOut.println("NOTICE "+_channel+" :"+msg); |
296 |
+ |
// wait a second before returning... |
297 |
+ |
// this ensures messages can't be sent too fast |
298 |
+ |
try {Thread.sleep(1000);} catch (InterruptedException e) {} |
299 |
|
} |
300 |
|
|
301 |
|
/** |
459 |
|
_socketOut.println("NICK "+newNick); |
460 |
|
_nickname = newNick; |
461 |
|
} |
462 |
+ |
else if(message.indexOf(cp.getProperty(_name, "Alerter.IRC.versionCommand"))!=-1) { |
463 |
+ |
sendMsg(getMsgSender(line)+", I am version "+REVISION.substring(11, REVISION.length() -2)+" of the i-scream alerting bot"); |
464 |
+ |
} |
465 |
|
else if(message.indexOf(cp.getProperty(_name, "Alerter.IRC.helpCommand"))!=-1) { |
466 |
< |
sendPrivMsg(getMsgSender(line), "I am the i-scream alerting bot revision "+REVISION.substring(11, REVISION.length() -2)); |
466 |
> |
sendPrivMsg(getMsgSender(line), "Hello, I am the i-scream alerting bot version "+REVISION.substring(11, REVISION.length() -2)); |
467 |
|
sendPrivMsg(getMsgSender(line), "I understand the following commands;"); |
468 |
|
sendPrivMsg(getMsgSender(line), cp.getProperty(_name, "Alerter.IRC.stopCommand")); |
469 |
|
sendPrivMsg(getMsgSender(line), cp.getProperty(_name, "Alerter.IRC.startCommand")); |