Command = #irc_command{ command = "PRIVMSG",
middles = [ Destination ],
trailing = Content },
- gen_server:cast(ConnectionPid, {send_command, Command}),
+ irc_conn:send_command(ConnectionPid, Command),
{noreply, State}.
-vsn(2).
-export([
- start_link/3
+ start_link/3,
+ send_command/2
]).
-export([
gen_server:start_link(?MODULE,
{Instance, Supervisor, TableId}, []).
+send_command(Pid, Command) ->
+ gen_server:cast(Pid, {send_command, Command}).
+
init({Instance, Supervisor, TableId}) ->
ets:insert(TableId, {irc_conn_pid, self()}), % record the connection PID in the table