Behold, TAPOAFTSM! The Awesome Power Of A Fully Type-Safe Mothership.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4246 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -504,7 +504,7 @@ public class ChatDirector extends BasicDirector
|
||||
* of success or failure.
|
||||
*/
|
||||
public void requestTell (final Name target, String msg,
|
||||
final ResultListener rl)
|
||||
final ResultListener<Name> rl)
|
||||
{
|
||||
// make sure they can say what they want to say
|
||||
final String message = filter(msg, target, true);
|
||||
@@ -1263,13 +1263,14 @@ public class ChatDirector extends BasicDirector
|
||||
history[0] = histEntry;
|
||||
|
||||
// request to send this text as a tell message
|
||||
requestTell(target, escapeMessage(message), new ResultListener() {
|
||||
public void requestCompleted (Object result) {
|
||||
requestTell(target, escapeMessage(message),
|
||||
new ResultListener<Name>() {
|
||||
public void requestCompleted (Name target) {
|
||||
// replace the full one in the history with just:
|
||||
// /tell "<handle>"
|
||||
String newEntry = "/" + command + " " +
|
||||
(useQuotes ? ("\"" + result + "\"")
|
||||
: String.valueOf(result)) + " ";
|
||||
(useQuotes ? ("\"" + target + "\"")
|
||||
: String.valueOf(target)) + " ";
|
||||
_history.remove(newEntry);
|
||||
int dex = _history.lastIndexOf("/" + histEntry);
|
||||
if (dex >= 0) {
|
||||
|
||||
@@ -150,7 +150,7 @@ public class MuteDirector extends BasicDirector
|
||||
*/
|
||||
public Name[] getMuted ()
|
||||
{
|
||||
return (Name[]) _mutelist.toArray(new Name[_mutelist.size()]);
|
||||
return _mutelist.toArray(new Name[_mutelist.size()]);
|
||||
}
|
||||
|
||||
// documentation inherited from interface ChatFilter
|
||||
@@ -175,9 +175,9 @@ public class MuteDirector extends BasicDirector
|
||||
*/
|
||||
protected void notifyObservers (final Name username, final boolean muted)
|
||||
{
|
||||
_observers.apply(new ObserverList.ObserverOp() {
|
||||
public boolean apply (Object observer) {
|
||||
((MuteObserver)observer).muteChanged(username, muted);
|
||||
_observers.apply(new ObserverList.ObserverOp<MuteObserver>() {
|
||||
public boolean apply (MuteObserver observer) {
|
||||
observer.muteChanged(username, muted);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
@@ -187,9 +187,9 @@ public class MuteDirector extends BasicDirector
|
||||
protected ChatDirector _chatdir;
|
||||
|
||||
/** The mutelist. */
|
||||
protected HashSet _mutelist = new HashSet();
|
||||
protected HashSet<Name> _mutelist = new HashSet<Name>();
|
||||
|
||||
/** List of mutelist observers. */
|
||||
protected ObserverList _observers =
|
||||
new ObserverList(ObserverList.FAST_UNSAFE_NOTIFY);
|
||||
protected ObserverList<MuteObserver> _observers =
|
||||
new ObserverList<MuteObserver>(ObserverList.FAST_UNSAFE_NOTIFY);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user