com.leafdigital.irc.api
Interface WatchList

All Superinterfaces:
Singleton

public interface WatchList
extends Singleton

Singleton that manages the list of people being watched. The program uses the server's WATCH facility if available, or ISON if not, to maintain the list.


Method Summary
 boolean addMask(IRCUserAddress mask)
          Adds a mask to the watch list.
 void addTemporaryMask(Server s, IRCUserAddress mask)
          Adds a mask to the temporary watch list (doesn't show in UI).
 IRCUserAddress[] getMasks()
          Returns the list of masks.
 boolean isKnown(Server s, java.lang.String nick)
          Checks whether we know the online status of a user.
 boolean isOnline(Server s, java.lang.String nick)
          Checks whether a user on the watch list is online.
 boolean removeMask(IRCUserAddress mask)
          Removes a mask from the watch list.
 void removeTemporaryMask(Server s, IRCUserAddress mask)
          Removes a mask from the temporary watch list.
 

Method Detail

addMask

boolean addMask(IRCUserAddress mask)
Adds a mask to the watch list.

Masks are of the form nick!user@host and may include * wildcards in user and host but not in nickname. If you add a mask that doesn't include a !, it assumes it's a nickname. If you add a mask that's already present, nothing happens. For servers that don't support WATCH, the username and host are ignored.

Parameters:
mask - Mask to add
Returns:
True if mask was added, false if it already exists

addTemporaryMask

void addTemporaryMask(Server s,
                      IRCUserAddress mask)
Adds a mask to the temporary watch list (doesn't show in UI). After calling this, removeTemporaryMask must be called the same number of times.

Parameters:
s - Server
mask - Mask to add

removeMask

boolean removeMask(IRCUserAddress mask)
Removes a mask from the watch list. Has no effect if it isn't there.

Parameters:
mask - Mask to remove
Returns:
True if mask was removed, false if it wasn't there

removeTemporaryMask

void removeTemporaryMask(Server s,
                         IRCUserAddress mask)
Removes a mask from the temporary watch list.

Parameters:
s - Server
mask - Mask to remove

getMasks

IRCUserAddress[] getMasks()
Returns the list of masks.

Returns:
List of all masks (in arbitrary order)

isKnown

boolean isKnown(Server s,
                java.lang.String nick)
Checks whether we know the online status of a user. We know the status if a mask (temp or permanent) has been added and a response from the server has been received.

Parameters:
s - Server
nick - Nickname
Returns:
True if we know whether they're online or not

isOnline

boolean isOnline(Server s,
                 java.lang.String nick)
Checks whether a user on the watch list is online.

Parameters:
s - Server to look on
nick - Nick to look for
Returns:
True if they are present, false otherwise


Copyright © 2011 Samuel Marshall. All rights reserved.