feat: 加群邀请上报

fix: 加群和加好友post_type字段改为request
This commit is contained in:
linyuchen
2024-02-27 20:06:20 +08:00
parent 9faa56ec32
commit 0fd75b338f
4 changed files with 14 additions and 1 deletions

@@ -289,6 +289,16 @@ function onLoad() {
groupRequestEvent.flag = notify.seq;
postOB11Event(groupRequestEvent);
}
else if(notify.type == GroupNotifyTypes.INVITE_ME){
groupNotifies[notify.seq] = notify;
let groupInviteEvent = new OB11GroupRequestEvent();
groupInviteEvent.group_id = parseInt(notify.group.groupCode);
let user_id = (await NTQQApi.getUserDetailInfo(notify.user2.uid))?.uin
groupInviteEvent.user_id = parseInt(user_id);
groupInviteEvent.sub_type = "invite";
groupInviteEvent.flag = notify.seq;
postOB11Event(groupInviteEvent);
}
}
} catch (e) {
log("解析群通知失败", e.stack);

@@ -300,6 +300,7 @@ export interface RawMessage {
}
export enum GroupNotifyTypes {
INVITE_ME = 1,
INVITED_JOIN = 4, // 有人接受了邀请入群
JOIN_REQUEST = 7,
ADMIN_SET = 8,

@@ -3,7 +3,7 @@ import {EventType} from "../OB11BaseEvent";
export class OB11FriendRequestEvent extends OB11BaseNoticeEvent {
// post_type = EventType.REQUEST
post_type = EventType.REQUEST
user_id: number;
request_type: "friend" = "friend";
comment: string;

@@ -1,7 +1,9 @@
import {OB11GroupNoticeEvent} from "../notice/OB11GroupNoticeEvent";
import {EventType} from "../OB11BaseEvent";
export class OB11GroupRequestEvent extends OB11GroupNoticeEvent{
post_type = EventType.REQUEST;
request_type: "group" = "group";
sub_type: "add" | "invite" = "add";
comment: string;