From e406010374456c6ef7995b6fe622f267972510e2 Mon Sep 17 00:00:00 2001 From: ycc Date: Sun, 31 Dec 2023 23:39:30 +0100 Subject: [PATCH] #2 --- server/router.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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