diff options
author | Paul Schoenfelder <paulschoenfelder@gmail.com> | 2016-09-12 12:26:57 -0500 |
---|---|---|
committer | Paul Schoenfelder <paulschoenfelder@gmail.com> | 2016-09-12 12:26:57 -0500 |
commit | f55a53db7912d8e64941dc661402a1eaabb87402 (patch) | |
tree | 79bd9cd5cc98599f97f83003739c55436850e004 /lib | |
parent | Add failing test for Slack IRC bridge. See #52 (diff) |
Handle RPL_NOTOPIC in client
Diffstat (limited to 'lib')
-rw-r--r-- | lib/exirc/client.ex | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/exirc/client.ex b/lib/exirc/client.ex index 81a2f0a..96179cf 100644 --- a/lib/exirc/client.ex +++ b/lib/exirc/client.ex @@ -585,6 +585,15 @@ defmodule ExIrc.Client do send_event {:topic_changed, channel, topic}, new_state {:noreply, new_state} end + def handle_data(%IrcMessage{cmd: @rpl_notopic, args: [channel]}, state) do + if state.debug? do + debug "INITIAL TOPIC MSG" + debug "1. NO TOPIC SET FOR #{channel}}" + end + channels = Channels.set_topic(state.channels, channel, "No topic is set") + new_state = %{state | channels: channels} + {:noreply, new_state} + end # Called when the topic changes while we're in the channel def handle_data(%IrcMessage{cmd: "TOPIC", args: [channel, topic]}, state) do if state.debug?, do: debug "TOPIC CHANGED FOR #{channel} TO #{topic}" |