From f55a53db7912d8e64941dc661402a1eaabb87402 Mon Sep 17 00:00:00 2001 From: Paul Schoenfelder Date: Mon, 12 Sep 2016 12:26:57 -0500 Subject: Handle RPL_NOTOPIC in client --- lib/exirc/client.ex | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib') 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}" -- cgit v1.2.3