Skip to content

Commit

Permalink
First attempt at propogating away status, currently broken.
Browse files Browse the repository at this point in the history
  • Loading branch information
ks07 committed Sep 14, 2011
1 parent 50c4858 commit 499f44c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/de/johannes13/minecraft/bukkit/chat/inspircd/Ircd.java
Expand Up @@ -504,6 +504,17 @@ public boolean isValid(String channel) {
return true;
}

public void sendAway(PlayerMetadata src, String message) {
// FIXME
this.println(":" + src.getUid() + " AWAY :I'm busy lemme rest. ");
//this.println(":" + sid + " MODE " + src.getUid() + " +a");
}

public void sendBack(PlayerMetadata src) {
// TODO: Check this works!
this.println(":" + src.getUid() + " AWAY");
}

public void sendAction(PlayerMetadata src, String channel, String message) {
this.println(":" + src.getUid() + " PRIVMSG " + channel + " :\u0001ACTION " + message + "\u0001");
}
Expand Down
Expand Up @@ -96,9 +96,11 @@ public boolean onCommand(CommandSender sender, Command cmd, String commandLabel,
case AWAY:
if (pm.isAway()) {
pm.setAway(false);
this.ircd.sendBack(pm);
getServer().broadcastMessage(ChatColor.YELLOW + "[" + p.getName() + " is no longer away.]");
} else {
pm.setAway(true);
this.ircd.sendAway(pm, "I am away.");
getServer().broadcastMessage(ChatColor.YELLOW + "[" + p.getName() + " is now away.]");
}
return true;
Expand Down

0 comments on commit 499f44c

Please sign in to comment.