#2
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
ycc 2023-12-31 23:39:30 +01:00
parent 289e39c677
commit e406010374

View File

@ -129,13 +129,16 @@ func (r *RedisRouter) Route(msg *meowlib.ToServerMessage) (*meowlib.FromServerMe
from_server.Invitation.Expiry = expiry.UTC().Unix() from_server.Invitation.Expiry = expiry.UTC().Unix()
case 2: // get invitation case 2: // get invitation
from_server.Invitation = &meowlib.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 != nil {
if err.Error() == "auth failed" { if err.Error() == "auth failed" {
from_server.Invitation.Payload = []byte("authentication failure") from_server.Invitation.Payload = []byte("authentication failure")
} else { } else {
from_server.Invitation.Payload = []byte("invitation expired") from_server.Invitation.Payload = []byte("invitation expired")
} }
} else {
from_server.Invitation.Payload = append(from_server.Invitation.Payload, invitation...) // protobuf invitation
} }
/* should not happen /* should not happen