mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
chore: revert todo
This commit is contained in:
parent
0f5ef03d63
commit
f7268c30ca
@ -23,7 +23,7 @@ export interface ChatCacheList {
|
|||||||
export interface ChatCacheListItem {
|
export interface ChatCacheListItem {
|
||||||
chatType: ChatType;
|
chatType: ChatType;
|
||||||
basicChatCacheInfo: ChatCacheListItemBasic;
|
basicChatCacheInfo: ChatCacheListItemBasic;
|
||||||
guildChatCacheInfo: unknown[]; // work: 没用过频道所以不知道这里边的详细内容
|
guildChatCacheInfo: unknown[]; // TODO: 没用过频道所以不知道这里边的详细内容
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ChatCacheListItemBasic {
|
export interface ChatCacheListItemBasic {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// work:further refactor in NapCat.Packet v2
|
// TODO: further refactor in NapCat.Packet v2
|
||||||
import { NapProtoMsg, ProtoField, ScalarType } from "@napneko/nap-proto-core";
|
import { NapProtoMsg, ProtoField, ScalarType } from "@napneko/nap-proto-core";
|
||||||
|
|
||||||
const BodyInner = {
|
const BodyInner = {
|
||||||
|
@ -210,7 +210,7 @@ export class NapCatCore {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
groupListener.onMemberListChange = (arg) => {
|
groupListener.onMemberListChange = (arg) => {
|
||||||
// work:应该加一个内部自己维护的成员变动callback,用于判断成员变化通知
|
// TODO: 应该加一个内部自己维护的成员变动callback,用于判断成员变化通知
|
||||||
const groupCode = arg.sceneId.split('_')[0];
|
const groupCode = arg.sceneId.split('_')[0];
|
||||||
if (this.apis.GroupApi.groupMemberCache.has(groupCode)) {
|
if (this.apis.GroupApi.groupMemberCache.has(groupCode)) {
|
||||||
const existMembers = this.apis.GroupApi.groupMemberCache.get(groupCode)!;
|
const existMembers = this.apis.GroupApi.groupMemberCache.get(groupCode)!;
|
||||||
|
@ -24,7 +24,7 @@ export class PacketClientSession {
|
|||||||
return this.context.operation;
|
return this.context.operation;
|
||||||
}
|
}
|
||||||
|
|
||||||
// work: global message element adapter (?
|
// TODO: global message element adapter (?
|
||||||
get msgConverter() {
|
get msgConverter() {
|
||||||
return this.context.msgConverter;
|
return this.context.msgConverter;
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ export type rawMsgWithSendMsg = {
|
|||||||
msg: PacketSendMsgElement[]
|
msg: PacketSendMsgElement[]
|
||||||
}
|
}
|
||||||
|
|
||||||
// work:make it become adapter?
|
// TODO: make it become adapter?
|
||||||
export class PacketMsgConverter {
|
export class PacketMsgConverter {
|
||||||
private isValidElementType(type: ElementType): type is keyof ElementToPacketMsgConverters {
|
private isValidElementType(type: ElementType): type is keyof ElementToPacketMsgConverters {
|
||||||
return SupportedElementTypes.includes(type);
|
return SupportedElementTypes.includes(type);
|
||||||
@ -116,7 +116,7 @@ export class PacketMsgConverter {
|
|||||||
[ElementType.MARKDOWN]: (element) => {
|
[ElementType.MARKDOWN]: (element) => {
|
||||||
return new PacketMsgMarkDownElement(element as SendMarkdownElement);
|
return new PacketMsgMarkDownElement(element as SendMarkdownElement);
|
||||||
},
|
},
|
||||||
// work:check this logic, move it in arkElement?
|
// TODO: check this logic, move it in arkElement?
|
||||||
[ElementType.STRUCTLONGMSG]: (element) => {
|
[ElementType.STRUCTLONGMSG]: (element) => {
|
||||||
return new PacketMultiMsgElement(element as SendStructLongMsgElement);
|
return new PacketMultiMsgElement(element as SendStructLongMsgElement);
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ import { ForwardMsgBuilder } from "@/common/forward-msg-builder";
|
|||||||
import { PacketMsg, PacketSendMsgElement } from "@/core/packet/message/message";
|
import { PacketMsg, PacketSendMsgElement } from "@/core/packet/message/message";
|
||||||
|
|
||||||
// raw <-> packet
|
// raw <-> packet
|
||||||
// work:SendStructLongMsgElement
|
// TODO: SendStructLongMsgElement
|
||||||
export abstract class IPacketMsgElement<T extends PacketSendMsgElement> {
|
export abstract class IPacketMsgElement<T extends PacketSendMsgElement> {
|
||||||
protected constructor(rawElement: T) {
|
protected constructor(rawElement: T) {
|
||||||
}
|
}
|
||||||
@ -118,7 +118,7 @@ export class PacketMsgReplyElement extends IPacketMsgElement<SendReplyElement> {
|
|||||||
this.targetUin = +(element.replyElement.senderUin ?? 0);
|
this.targetUin = +(element.replyElement.senderUin ?? 0);
|
||||||
this.targetUid = element.replyElement.senderUidStr ?? '';
|
this.targetUid = element.replyElement.senderUidStr ?? '';
|
||||||
this.time = +(element.replyElement.replyMsgTime ?? 0);
|
this.time = +(element.replyElement.replyMsgTime ?? 0);
|
||||||
this.elems = []; // work:in replyElement.sourceMsgTextElems
|
this.elems = []; // TODO: in replyElement.sourceMsgTextElems
|
||||||
}
|
}
|
||||||
|
|
||||||
get isGroupReply(): boolean {
|
get isGroupReply(): boolean {
|
||||||
@ -131,7 +131,7 @@ export class PacketMsgReplyElement extends IPacketMsgElement<SendReplyElement> {
|
|||||||
origSeqs: [this.isGroupReply ? this.messageClientSeq : this.messageSeq],
|
origSeqs: [this.isGroupReply ? this.messageClientSeq : this.messageSeq],
|
||||||
senderUin: BigInt(this.targetUin),
|
senderUin: BigInt(this.targetUin),
|
||||||
time: this.time,
|
time: this.time,
|
||||||
elems: [], // work:in replyElement.sourceMsgTextElems
|
elems: [], // TODO: in replyElement.sourceMsgTextElems
|
||||||
pbReserve: {
|
pbReserve: {
|
||||||
messageId: this.messageId,
|
messageId: this.messageId,
|
||||||
},
|
},
|
||||||
@ -346,9 +346,9 @@ export class PacketMsgPttElement extends IPacketMsgElement<SendPttElement> {
|
|||||||
constructor(element: SendPttElement) {
|
constructor(element: SendPttElement) {
|
||||||
super(element);
|
super(element);
|
||||||
this.filePath = element.pttElement.filePath;
|
this.filePath = element.pttElement.filePath;
|
||||||
this.fileSize = +element.pttElement.fileSize; // work:cc
|
this.fileSize = +element.pttElement.fileSize; // TODO: cc
|
||||||
this.fileMd5 = element.pttElement.md5HexStr;
|
this.fileMd5 = element.pttElement.md5HexStr;
|
||||||
this.fileDuration = Math.round(element.pttElement.duration); // work:cc
|
this.fileDuration = Math.round(element.pttElement.duration); // TODO: cc
|
||||||
}
|
}
|
||||||
|
|
||||||
get valid(): boolean {
|
get valid(): boolean {
|
||||||
|
@ -25,7 +25,7 @@ class DownloadOfflineFile extends PacketTransformer<typeof proto.OidbSvcTrpcTcp0
|
|||||||
return OidbBase.build(0xE37, 800, body, false, false);
|
return OidbBase.build(0xE37, 800, body, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// work:check
|
// TODO:check
|
||||||
parse(data: Buffer) {
|
parse(data: Buffer) {
|
||||||
const oidbBody = OidbBase.parse(data).body;
|
const oidbBody = OidbBase.parse(data).body;
|
||||||
return new NapProtoMsg(proto.OidbSvcTrpcTcp0XE37Response).decode(oidbBody);
|
return new NapProtoMsg(proto.OidbSvcTrpcTcp0XE37Response).decode(oidbBody);
|
||||||
|
@ -16,7 +16,7 @@ class FetchSessionKey extends PacketTransformer<typeof proto.HttpConn0x6ff_501Re
|
|||||||
field4: 1,
|
field4: 1,
|
||||||
field6: 3,
|
field6: 3,
|
||||||
serviceTypes: [1, 5, 10, 21],
|
serviceTypes: [1, 5, 10, 21],
|
||||||
// tgt: "", // work:do we really need tgt? seems not
|
// tgt: "", // TODO: do we really need tgt? seems not
|
||||||
field9: 2,
|
field9: 2,
|
||||||
field10: 9,
|
field10: 9,
|
||||||
field11: 8,
|
field11: 8,
|
||||||
|
@ -16,7 +16,7 @@ class UploadGroupFile extends PacketTransformer<typeof proto.OidbSvcTrpcTcp0x6D6
|
|||||||
appId: 4,
|
appId: 4,
|
||||||
busId: 102,
|
busId: 102,
|
||||||
entrance: 6,
|
entrance: 6,
|
||||||
targetDirectory: '/', // work:
|
targetDirectory: '/', // TODO:
|
||||||
fileName: file.fileName,
|
fileName: file.fileName,
|
||||||
localDirectory: `/${file.fileName}`,
|
localDirectory: `/${file.fileName}`,
|
||||||
fileSize: BigInt(file.fileSize),
|
fileSize: BigInt(file.fileSize),
|
||||||
|
@ -40,7 +40,7 @@ class UploadGroupImage extends PacketTransformer<typeof proto.NTV2RichMediaResp>
|
|||||||
fileName: img.name,
|
fileName: img.name,
|
||||||
type: {
|
type: {
|
||||||
type: 1,
|
type: 1,
|
||||||
picFormat: img.picType, //work:extend NapCat imgType /cc @MliKiowa
|
picFormat: img.picType, //TODO: extend NapCat imgType /cc @MliKiowa
|
||||||
videoFormat: 0,
|
videoFormat: 0,
|
||||||
voiceFormat: 0,
|
voiceFormat: 0,
|
||||||
},
|
},
|
||||||
@ -59,7 +59,7 @@ class UploadGroupImage extends PacketTransformer<typeof proto.NTV2RichMediaResp>
|
|||||||
extBizInfo: {
|
extBizInfo: {
|
||||||
pic: {
|
pic: {
|
||||||
bytesPbReserveTroop: Buffer.from("0800180020004200500062009201009a0100a2010c080012001800200028003a00", 'hex'),
|
bytesPbReserveTroop: Buffer.from("0800180020004200500062009201009a0100a2010c080012001800200028003a00", 'hex'),
|
||||||
textSummary: "Nya~", // work:
|
textSummary: "Nya~", // TODO:
|
||||||
},
|
},
|
||||||
video: {
|
video: {
|
||||||
bytesPbReserve: Buffer.alloc(0),
|
bytesPbReserve: Buffer.alloc(0),
|
||||||
|
@ -40,7 +40,7 @@ class UploadPrivateImage extends PacketTransformer<typeof proto.NTV2RichMediaRes
|
|||||||
fileName: img.name,
|
fileName: img.name,
|
||||||
type: {
|
type: {
|
||||||
type: 1,
|
type: 1,
|
||||||
picFormat: img.picType, //work:extend NapCat imgType /cc @MliKiowa
|
picFormat: img.picType, //TODO: extend NapCat imgType /cc @MliKiowa
|
||||||
videoFormat: 0,
|
videoFormat: 0,
|
||||||
voiceFormat: 0,
|
voiceFormat: 0,
|
||||||
},
|
},
|
||||||
@ -59,7 +59,7 @@ class UploadPrivateImage extends PacketTransformer<typeof proto.NTV2RichMediaRes
|
|||||||
extBizInfo: {
|
extBizInfo: {
|
||||||
pic: {
|
pic: {
|
||||||
bytesPbReserveTroop: Buffer.from("0800180020004200500062009201009a0100a2010c080012001800200028003a00", 'hex'),
|
bytesPbReserveTroop: Buffer.from("0800180020004200500062009201009a0100a2010c080012001800200028003a00", 'hex'),
|
||||||
textSummary: "Nya~", // work:
|
textSummary: "Nya~", // TODO:
|
||||||
},
|
},
|
||||||
video: {
|
video: {
|
||||||
bytesPbReserve: Buffer.alloc(0),
|
bytesPbReserve: Buffer.alloc(0),
|
||||||
|
@ -15,7 +15,7 @@ type Payload = FromSchema<typeof SchemaData>;
|
|||||||
export class GetGroupFileSystemInfo extends BaseAction<Payload, {
|
export class GetGroupFileSystemInfo extends BaseAction<Payload, {
|
||||||
file_count: number,
|
file_count: number,
|
||||||
limit_count: number, // unimplemented
|
limit_count: number, // unimplemented
|
||||||
used_space: number, // work:unimplemented, but can be implemented later
|
used_space: number, // TODO:unimplemented, but can be implemented later
|
||||||
total_space: number, // unimplemented, 10 GB by default
|
total_space: number, // unimplemented, 10 GB by default
|
||||||
}> {
|
}> {
|
||||||
actionName = ActionName.GoCQHTTP_GetGroupFileSystemInfo;
|
actionName = ActionName.GoCQHTTP_GetGroupFileSystemInfo;
|
||||||
|
@ -7,7 +7,6 @@ export abstract class GetPacketStatusDepends<PT, RT> extends BaseAction<PT, RT>
|
|||||||
|
|
||||||
protected async check(payload: PT): Promise<BaseCheckResult>{
|
protected async check(payload: PT): Promise<BaseCheckResult>{
|
||||||
if (!this.core.apis.PacketApi.available) {
|
if (!this.core.apis.PacketApi.available) {
|
||||||
// work:add error stack?
|
|
||||||
return {
|
return {
|
||||||
valid: false,
|
valid: false,
|
||||||
message: "packetBackend不可用,请参照文档 https://napneko.github.io/config/advanced 和启动日志检查packetBackend状态或进行配置!" +
|
message: "packetBackend不可用,请参照文档 https://napneko.github.io/config/advanced 和启动日志检查packetBackend状态或进行配置!" +
|
||||||
|
@ -5,7 +5,7 @@ export type GroupDecreaseSubType = 'leave' | 'kick' | 'kick_me';
|
|||||||
|
|
||||||
export class OB11GroupDecreaseEvent extends OB11GroupNoticeEvent {
|
export class OB11GroupDecreaseEvent extends OB11GroupNoticeEvent {
|
||||||
notice_type = 'group_decrease';
|
notice_type = 'group_decrease';
|
||||||
sub_type: GroupDecreaseSubType = 'leave'; // work:实现其他几种子类型的识别 ("leave" | "kick" | "kick_me")
|
sub_type: GroupDecreaseSubType = 'leave'; // TODO: 实现其他几种子类型的识别 ("leave" | "kick" | "kick_me")
|
||||||
operator_id: number;
|
operator_id: number;
|
||||||
|
|
||||||
constructor(core: NapCatCore, groupId: number, userId: number, operatorId: number, subType: GroupDecreaseSubType = 'leave') {
|
constructor(core: NapCatCore, groupId: number, userId: number, operatorId: number, subType: GroupDecreaseSubType = 'leave') {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { OB11BaseNoticeEvent } from './OB11BaseNoticeEvent';
|
import { OB11BaseNoticeEvent } from './OB11BaseNoticeEvent';
|
||||||
import { NapCatCore } from '@/core';
|
import { NapCatCore } from '@/core';
|
||||||
|
|
||||||
//work: 输入状态事件 初步完成 Mlikiowa 需要做一些过滤
|
//TODO: 输入状态事件 初步完成 Mlikiowa 需要做一些过滤
|
||||||
export class OB11InputStatusEvent extends OB11BaseNoticeEvent {
|
export class OB11InputStatusEvent extends OB11BaseNoticeEvent {
|
||||||
notice_type = 'notify';
|
notice_type = 'notify';
|
||||||
sub_type = 'input_status';
|
sub_type = 'input_status';
|
||||||
|
@ -207,7 +207,7 @@ export class NapCatOneBot11Adapter {
|
|||||||
for (const adapterConfig of adapters) {
|
for (const adapterConfig of adapters) {
|
||||||
const existingAdapter = this.networkManager.findSomeAdapter(adapterConfig.name);
|
const existingAdapter = this.networkManager.findSomeAdapter(adapterConfig.name);
|
||||||
if (existingAdapter) {
|
if (existingAdapter) {
|
||||||
let networkChange = await existingAdapter.reload(adapterConfig);
|
const networkChange = await existingAdapter.reload(adapterConfig);
|
||||||
if (networkChange === OB11NetworkReloadType.NetWorkClose) {
|
if (networkChange === OB11NetworkReloadType.NetWorkClose) {
|
||||||
this.networkManager.closeSomeAdapters([existingAdapter]);
|
this.networkManager.closeSomeAdapters([existingAdapter]);
|
||||||
|
|
||||||
@ -638,7 +638,7 @@ export class NapCatOneBot11Adapter {
|
|||||||
// log("message update", message.sendStatus, message.msgId, message.msgSeq)
|
// log("message update", message.sendStatus, message.msgId, message.msgSeq)
|
||||||
const peer: Peer = { chatType: message.chatType, peerUid: message.peerUid, guildId: '' };
|
const peer: Peer = { chatType: message.chatType, peerUid: message.peerUid, guildId: '' };
|
||||||
if (message.recallTime != '0' && !cache.get(message.msgId)) {
|
if (message.recallTime != '0' && !cache.get(message.msgId)) {
|
||||||
//work:这个判断方法不太好,应该使用灰色消息元素来判断?
|
//TODO: 这个判断方法不太好,应该使用灰色消息元素来判断?
|
||||||
cache.put(message.msgId, true);
|
cache.put(message.msgId, true);
|
||||||
// 撤回消息上报
|
// 撤回消息上报
|
||||||
let oriMessageId = MessageUnique.getShortIdByMsgId(message.msgId);
|
let oriMessageId = MessageUnique.getShortIdByMsgId(message.msgId);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user