Fix bug preventing replying to last viewed topic

This commit is contained in:
Eric Budd 2018-05-10 18:07:08 -04:00
parent 958d09c5bc
commit 20b4adfc16
2 changed files with 3 additions and 4 deletions

View File

@ -9,7 +9,7 @@
* Message editing
* Allow shelling out to editor for message editing?
* Gracefully handle bad message files
* Fix topic selection when replying without topic ID
* ~Fix topic selection when replying without topic ID~
* ~Automatically display topics when opening~
* Add column headers for topics
* Mark unread topics/topics with unread replies in topics list

View File

@ -472,14 +472,13 @@ class Interface
Display.say
end
def reply(topic_id = nil)
topic_id ||= @reply_topic
def reply(topic_id = @reply_topic)
unless topic_id
Display.say "I can't reply to nothing! Include a topic ID or view a topic to reply to."
return
end
if parent = Corpus.find_topic_by_id(topic_id)
if parent = (Corpus.find_topic_by_id(topic_id) || Corpus.find_topic_by_hash(topic_id))
@reply_topic = parent.hash
else
Display.say "Could not reply; unable to find a topic with ID '#{topic_id}'"