/*
 * The MIT License
 *
 * Copyright (c) 2016 Marcelo "Ataxexe" Guimarães <ataxexe@devnull.tools>
 *
 * Permission  is hereby granted, free of charge, to any person obtaining
 * a  copy  of  this  software  and  associated  documentation files (the
 * "Software"),  to  deal  in the Software without restriction, including
 * without  limitation  the  rights to use, copy, modify, merge, publish,
 * distribute,  sublicense,  and/or  sell  copies of the Software, and to
 * permit  persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 * The  above  copyright  notice  and  this  permission  notice  shall be
 * included  in  all  copies  or  substantial  portions  of the Software.
 *
 * THE  SOFTWARE  IS  PROVIDED  "AS  IS",  WITHOUT  WARRANTY OF ANY KIND,
 * EXPRESS  OR  IMPLIED,  INCLUDING  BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN  NO  EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 * CLAIM,  DAMAGES  OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 * TORT  OR  OTHERWISE,  ARISING  FROM,  OUT OF OR IN CONNECTION WITH THE
 * SOFTWARE   OR   THE   USE   OR   OTHER   DEALINGS  IN  THE  SOFTWARE.
 */

package tools.devnull.boteco.plugins.user;

import tools.devnull.boteco.user.User;

/**
 * A class that represents a request to link a destination
 * to an user.
 */
public class LinkRequest {

  private final String user;
  private final String channel;
  private final String target;

  public LinkRequest(User user, String channel, String target) {
    this.user = user.id();
    this.channel = channel;
    this.target = target;
  }

  public LinkRequest(String user, String channel, String target) {
    this.user = user;
    this.channel = channel;
    this.target = target;
  }

  public String userId() {
    return user;
  }

  public String channel() {
    return channel;
  }

  public String target() {
    return target;
  }

}

@@ -1285,16 +1285,67 @@
 .user;%0A%0A
+import tools.devnull.boteco.message.IncomeMessage;%0A
 import t
@@ -1755,35 +1755,29 @@
 est(
-String user, String channel
+IncomeMessage message
 , St
@@ -1773,38 +1773,36 @@
 message, String 
-target
+user
 ) %7B%0A    this.use
@@ -1834,41 +1834,71 @@
 l = 
-channel;%0A    this.target = target
+message.channel().id();%0A    this.target = message.sender().id()
 ;%0A  

fix constructor