-- | Try to get op from ChanServ when we join a channel.
opOnJoin (SJoin (SUser n _ _) ch@(RChannel _)) = do
    ownNick <- getGlobal' botNick
    when (n == ownNick) requestOp



-- | NAMES reply - handles both RPL_NAMREPLY (353) and RPL_ENDOFNAMES (366);
-- the requester will be called on 353 and unhooked; or if, e.g., the channel
-- doesn't exist, the server will only send a 366 and the requester will be
-- called on that.
opOnJoin (SJoin (SUser n _ _) ch@(RChannel _)) = do
    ownNick <- getGlobal' botNick
    when (n == ownNick) requestOp



-- | NAMES reply - handles both RPL_NAMREPLY (353) and RPL_ENDOFNAMES (366);
-- the requester will be called on 353 and unhooked; or if, e.g., the channel
-- doesn't exist, the server will only send a 366 and the requester will be
-- called on that.
opOnJoin (SJoin (SUser n _ _) ch@(RChannel _)) = do
    ownNick <- getGlobal' botNick
    when (n == ownNick) requestOp



-- | NAMES reply - handles both RPL_NAMREPLY (353) and RPL_ENDOFNAMES (366);
-- the requester will be called on 353 and unhooked; or if, e.g., the channel
-- doesn't exist, the server will only send a 366 and the requester will be
-- called on that.