This commit is contained in:
手瓜一十雪 2024-07-29 08:29:24 +08:00
parent 92fe654850
commit e169199107
5 changed files with 36 additions and 5 deletions

View File

@ -99,6 +99,9 @@ export class NTQQMsgApi {
static async getSingleMsg(peer: Peer, seq: string) {
return await napCatCore.session.getMsgService().getSingleMsg(peer, seq);
}
static async fetchFavEmojiList(num:number) {
return napCatCore.session.getMsgService().fetchFavEmojiList("",num , true, true)
}
static async queryMsgsWithFilterExWithSeq(peer: Peer, msgSeq: string, msgTime: string, senderUid: string) {
let ret = await napCatCore.session.getMsgService().queryMsgsWithFilterEx('0', msgTime, msgSeq, {
chatInfo: peer,

View File

@ -393,8 +393,13 @@ export interface NodeIKernelMsgService {
translatePtt2Text(MsgId: string, Peer: {}, MsgElement: {}): unknown;
setPttPlayedState(...args: unknown[]): unknown;
fetchFavEmojiList(...args: unknown[]): unknown;
// NodeIQQNTWrapperSession fetchFavEmojiList [
// "",
// 48,
// true,
// true
// ]
fetchFavEmojiList(str: string, num: number, uk1: boolean, uk2: boolean): Promise<unknown>;
addFavEmoji(...args: unknown[]): unknown;
@ -663,7 +668,7 @@ export interface NodeIKernelMsgService {
dataMigrationGetMsgList(...args: unknown[]): unknown;
dataMigrationStopOperation(...args: unknown[]): unknown;
//新的希望
dataMigrationImportMsgPbRecord(DataMigrationMsgInfo: Array<{
extensionData: string//"Hex"

View File

@ -0,0 +1,20 @@
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
import BaseAction from '../BaseAction';
import { ActionName } from '../types';
import { NTQQMsgApi } from '@/core/apis';
const SchemaData = {
type: 'object',
properties: {
count: { type: 'number' },
}
} as const satisfies JSONSchema;
type Payload = FromSchema<typeof SchemaData>;
export class FetchCustomFace extends BaseAction<Payload, any> {
actionName = ActionName.FetchCustomFace;
PayloadSchema = SchemaData;
protected async _handle(payload: Payload) {
return await NTQQMsgApi.fetchFavEmojiList(payload.count || 48);
}
}

View File

@ -75,6 +75,7 @@ import SetEssenceMsg from './group/SetEssenceMsg';
import GetRecentContact from './user/GetRecentContact';
import { GetProfileLike } from './extends/GetProfileLike';
import SetGroupHeader from './extends/SetGroupHeader';
import { FetchCustomFace } from './extends/FetchCustomFace';
export const actionHandlers = [
new RebootNormal(),
@ -156,7 +157,8 @@ export const actionHandlers = [
new GetRecentContact(),
new MarkAllMsgAsRead(),
new GetProfileLike(),
new SetGroupHeader()
new SetGroupHeader(),
new FetchCustomFace()
];
function initActionMap() {

View File

@ -99,5 +99,6 @@ export enum ActionName {
GetRecentContact = 'get_recent_contact',
_MarkAllMsgAsRead = '_mark_all_as_read',
GetProfileLike = 'get_profile_like',
SetGroupHeader = "set_group_head"
SetGroupHeader = "set_group_head",
FetchCustomFace = "fetch_custom_face"
}