diff --git a/server/router.go b/server/router.go index 97cb650..d58c4da 100644 --- a/server/router.go +++ b/server/router.go @@ -129,13 +129,16 @@ func (r *RedisRouter) Route(msg *meowlib.ToServerMessage) (*meowlib.FromServerMe from_server.Invitation.Expiry = expiry.UTC().Unix() case 2: // get invitation from_server.Invitation = &meowlib.Invitation{} - from_server.Invitation.Payload, err = r.GetInvitation(msg.Invitation.Shortcode, msg.Invitation.Password) + invitation, err := r.GetInvitation(msg.Invitation.Shortcode, msg.Invitation.Password) + if err != nil { if err.Error() == "auth failed" { from_server.Invitation.Payload = []byte("authentication failure") } else { from_server.Invitation.Payload = []byte("invitation expired") } + } else { + from_server.Invitation.Payload = append(from_server.Invitation.Payload, invitation...) // protobuf invitation } /* should not happen