Loading server/core_user.go +1 −1 Original line number Diff line number Diff line Loading @@ -149,7 +149,7 @@ func UserExistsAndDoesNotBlock(db *sql.DB, checkUserID, blocksUserID uuid.UUID) var count int err := db.QueryRow(` SELECT COUNT(id) FROM users WHERE id = $1 AND NOT EXISTS ( WHERE id = $1::UUID AND NOT EXISTS ( SELECT state FROM user_edge WHERE source_id = $1::UUID AND destination_id = $2::UUID AND state = 3 ) Loading server/pipeline_channel.go +2 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import ( "unicode/utf8" "database/sql" "github.com/golang/protobuf/ptypes/timestamp" "github.com/golang/protobuf/ptypes/wrappers" "github.com/heroiclabs/nakama/api" Loading Loading @@ -119,6 +120,7 @@ func (p *Pipeline) channelJoin(logger *zap.Logger, session Session, envelope *rt // Check if the other user exists and has not blocked this user. allowed, err := UserExistsAndDoesNotBlock(p.db, uid, userID) if err != nil { logger.Warn("Failed to execute query to check user and friend block state", zap.Error(err), zap.String("uid", userID.String()), zap.String("friend", uid.String())) session.Send(false, 0, &rtapi.Envelope{Cid: envelope.Cid, Message: &rtapi.Envelope_Error{Error: &rtapi.Error{ Code: int32(rtapi.Error_RUNTIME_EXCEPTION), Message: "Failed to look up user ID", Loading Loading
server/core_user.go +1 −1 Original line number Diff line number Diff line Loading @@ -149,7 +149,7 @@ func UserExistsAndDoesNotBlock(db *sql.DB, checkUserID, blocksUserID uuid.UUID) var count int err := db.QueryRow(` SELECT COUNT(id) FROM users WHERE id = $1 AND NOT EXISTS ( WHERE id = $1::UUID AND NOT EXISTS ( SELECT state FROM user_edge WHERE source_id = $1::UUID AND destination_id = $2::UUID AND state = 3 ) Loading
server/pipeline_channel.go +2 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import ( "unicode/utf8" "database/sql" "github.com/golang/protobuf/ptypes/timestamp" "github.com/golang/protobuf/ptypes/wrappers" "github.com/heroiclabs/nakama/api" Loading Loading @@ -119,6 +120,7 @@ func (p *Pipeline) channelJoin(logger *zap.Logger, session Session, envelope *rt // Check if the other user exists and has not blocked this user. allowed, err := UserExistsAndDoesNotBlock(p.db, uid, userID) if err != nil { logger.Warn("Failed to execute query to check user and friend block state", zap.Error(err), zap.String("uid", userID.String()), zap.String("friend", uid.String())) session.Send(false, 0, &rtapi.Envelope{Cid: envelope.Cid, Message: &rtapi.Envelope_Error{Error: &rtapi.Error{ Code: int32(rtapi.Error_RUNTIME_EXCEPTION), Message: "Failed to look up user ID", Loading