From 68ab8bc18d92eea19600e584755b911f74987b7e Mon Sep 17 00:00:00 2001 From: Matt Mullins Date: Sat, 4 May 2013 23:57:57 -0700 Subject: [PATCH] Split out routing key creation into a new function --- irc/irc_conn.erl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/irc/irc_conn.erl b/irc/irc_conn.erl index 3d4ba62..05eff3c 100644 --- a/irc/irc_conn.erl +++ b/irc/irc_conn.erl @@ -168,11 +168,13 @@ join_channel(Channel, State) -> Command = #irc_command{command = "JOIN", middles = [Channel]}, send_command(Command). -add_amqp_listener(Instance, ObjectSup) -> +get_routing_key(Instance) -> InstanceKey = irc_amqp_listener:encode_routing_key(atom_to_list(Instance)), - RoutingKey = InstanceKey ++ ".output.*", + InstanceKey ++ ".output.*". + +add_amqp_listener(Instance, ObjectSup) -> {ok, _ChildPid} = irc_object_sup:add_amqp_listener( - ObjectSup, self(), RoutingKey). + ObjectSup, self(), get_routing_key(Instance)). %% @doc Splits a buffer into full lines, keeping whatever is left over %% Returns either {ok, [Line], Remaining} or none. -- 2.11.0