X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Firc%2FConnection.java;h=c7d5428157c8e73d76fcec2f37c115e45e022f24;hb=2a62474cbd0e3ac9eb30dc4153faf91edf8e1453;hp=239f0a2a7ba25c5fc6ee7b789be2c1d50ad15555;hpb=d1fbb9c5a7e32ed55e5ddc2c107be6c4d31ba5cb;p=xudocci.git diff --git a/src/main/java/net/pterodactylus/irc/Connection.java b/src/main/java/net/pterodactylus/irc/Connection.java index 239f0a2..c7d5428 100644 --- a/src/main/java/net/pterodactylus/irc/Connection.java +++ b/src/main/java/net/pterodactylus/irc/Connection.java @@ -201,6 +201,19 @@ public class Connection extends AbstractExecutionThreadService implements Servic // /** + * Checks whether the given source is the client represented by this + * connection. + * + * @param source + * The source to check + * @return {@code true} if this connection represents the given source, {@code + * false} otherwise + */ + public boolean isSource(Source source) { + return source.nick().isPresent() && source.nick().get().equals(nickname); + } + + /** * Joins the given channel. * * @param channel