01: package dalma.endpoints.irc;
02:
03: /**
04: * Receives a notification when a new {@link Session} is
05: * opened from the other party.
06: *
07: * @author Kohsuke Kawaguchi
08: */
09: public interface NewSessionListener {
10: /**
11: * If a {@link Buddy} (with whom we don't have {@link PrivateChat} with)
12: * sends us a message, a new {@link PrivateChat} is opened and this method
13: * gets invoked.
14: *
15: * <p>
16: * If the application decides to ignore the buddy, call {@link PrivateChat#close()}
17: * to terminate the session immediately.
18: *
19: * @param chat
20: * the newly created {@link PrivateChat} instance that represents
21: * the conversation just started. The message received can be obtained
22: * by calling {@link PrivateChat#waitForNextMessage()}.
23: */
24: void onNewPrivateChat(PrivateChat chat);
25:
26: /**
27: * If someone invites us to a {@link Channel}. this method is invoked.
28: *
29: * <p>
30: * If the application is not interested in joining, it can just return from this method
31: * without doing anything. Or it can call {@link Channel#join()} to join this channel.
32: *
33: * @param sender
34: * The {@link Buddy} who sent us the invitation. never null.
35: * @param channel
36: * The {@link Channel} to which we are invited to.
37: */
38: void onInvite(Buddy sender, Channel channel);
39: }
|