fix: 解散群作废 scheduled 时消息级回执改用 rejected
This commit is contained in:
@@ -296,6 +296,16 @@ WHERE m.id='gm1' AND d.endpoint_id='bob'`).Scan(&reason)
|
||||
if err != nil || state != "completed" || mreason != "group_dissolved" {
|
||||
t.Fatalf("state=%s reason=%s err=%v", state, mreason, err)
|
||||
}
|
||||
// 消息级回执 state 须为协议枚举 rejected,不得写成消息状态 completed(issue #6 / DEVELOPMENT 6.4)
|
||||
var rState, rReason, rEndpoint string
|
||||
err = db.Read.QueryRow(`
|
||||
SELECT state, reason, endpoint_id FROM receipts WHERE sender_id='alice' AND msg_id='gm2'`).Scan(&rState, &rReason, &rEndpoint)
|
||||
if err != nil {
|
||||
t.Fatalf("receipt for dissolved scheduled: %v", err)
|
||||
}
|
||||
if rState != "rejected" || rReason != "group_dissolved" || rEndpoint != "" {
|
||||
t.Fatalf("receipt state=%q reason=%q endpoint=%q want rejected/group_dissolved/empty", rState, rReason, rEndpoint)
|
||||
}
|
||||
// 同编号新建群
|
||||
created2, err := gApp.Create(ctx, "alice", &protocol.GroupCreate{
|
||||
V: protocol.Version, Type: protocol.TypeGroupCreate, RID: "6",
|
||||
|
||||
Reference in New Issue
Block a user