host.go: Fixing bug with /reply#230
Merged
shazow merged 1 commit intoshazow:masterfrom Apr 28, 2017
ste5e99:replyfix
Merged
Conversation
shazow
reviewed
Apr 27, 2017
host.go
Outdated
| completed = "/msg " + replyTo.Name() | ||
| name := replyTo.Name() | ||
| _, found := h.GetUser(name) | ||
| if !found { |
Owner
There was a problem hiding this comment.
isn't that the opposite condition we want?
shazow
reviewed
Apr 27, 2017
| _, found := h.GetUser(name) | ||
| if !found { | ||
| completed = "/msg " + name | ||
| } |
Owner
There was a problem hiding this comment.
if not found, could you also reset the state of u.ReplyTo? I think u.SetReplyTo(nil) should do the trick.
Contributor
Author
|
I fixed my logic mistake and added an else branch to do |
Owner
|
Awesome looks good. Now why is travis upset... |
Contributor
Author
|
Not entirely sure. It builds normally but it times out on receiving output
for some reason.
…On Thu, Apr 27, 2017, 9:00 PM Andrey Petrov ***@***.***> wrote:
Awesome looks good. Now why is travis upset...
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#230 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AOnurcl8KX9EtLKlicOumCj2m7OiXFsGks5r0To4gaJpZM4NKwfg>
.
|
Owner
|
Tried it locally, works, yolo. |
shazow
reviewed
Apr 28, 2017
| name := target.Name() | ||
| _, found := h.GetUser(name) | ||
| if !found { | ||
| return errors.New("user not found") |
Owner
There was a problem hiding this comment.
For some reason I couldn't make it reach this branch locally, weird.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wrapping the reply action within a Host.GetUser() check to safely assure that the user being replied to is still online. This should resolve #228.
Screenshot included demo'ing the fix:
