mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ef9189055c | ||
![]() |
5cc3719125 | ||
![]() |
5d46f41348 | ||
![]() |
3c2c1963f4 | ||
![]() |
4896ca9279 | ||
![]() |
f0afba6cd9 | ||
![]() |
bd717c298a |
@@ -4,7 +4,7 @@
|
||||
"name": "NapCatQQ",
|
||||
"slug": "NapCat.Framework",
|
||||
"description": "高性能的 OneBot 11 协议实现",
|
||||
"version": "3.1.1",
|
||||
"version": "3.1.3",
|
||||
"icon": "./logo.png",
|
||||
"authors": [
|
||||
{
|
||||
|
@@ -2,7 +2,7 @@
|
||||
"name": "napcat",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"version": "3.1.1",
|
||||
"version": "3.1.3",
|
||||
"scripts": {
|
||||
"build:framework": "vite build --mode framework",
|
||||
"build:shell": "vite build --mode shell",
|
||||
|
@@ -1 +1 @@
|
||||
export const napCatVersion = '3.1.1';
|
||||
export const napCatVersion = '3.1.3';
|
||||
|
@@ -30,7 +30,7 @@ export class NTQQFileApi {
|
||||
context: InstanceContext;
|
||||
core: NapCatCore;
|
||||
rkeyManager: RkeyManager;
|
||||
packetRkey: Array<{ rkey: string; time: number; type: number; }> | undefined;
|
||||
packetRkey: Array<{ rkey: string; time: number; type: number; ttl: bigint }> | undefined;
|
||||
|
||||
constructor(context: InstanceContext, core: NapCatCore) {
|
||||
this.context = context;
|
||||
@@ -378,10 +378,12 @@ export class NTQQFileApi {
|
||||
};
|
||||
try {
|
||||
if (this.core.apis.PacketApi.available) {
|
||||
if ((!this.packetRkey || this.packetRkey[0].time > Date.now() / 1000)) {
|
||||
let rkey_expired_private = !this.packetRkey || this.packetRkey[0].time + Number(this.packetRkey[0].ttl) < Date.now() / 1000;
|
||||
let rkey_expired_group = !this.packetRkey || this.packetRkey[0].time + Number(this.packetRkey[0].ttl) < Date.now() / 1000;
|
||||
if (rkey_expired_private || rkey_expired_group) {
|
||||
this.packetRkey = await this.core.apis.PacketApi.sendRkeyPacket();
|
||||
}
|
||||
if (this.packetRkey.length > 0) {
|
||||
if (this.packetRkey && this.packetRkey.length > 0) {
|
||||
rkeyData.group_rkey = this.packetRkey[1].rkey.slice(6);
|
||||
rkeyData.private_rkey = this.packetRkey[0].rkey.slice(6);
|
||||
rkeyData.online_rkey = true;
|
||||
|
@@ -14,6 +14,7 @@ export const OidbSvcTrpcTcp0X9067_202Key = {
|
||||
//Rsp
|
||||
export const OidbSvcTrpcTcp0X9067_202_RkeyList = {
|
||||
rkey: ProtoField(1, ScalarType.STRING),
|
||||
ttl: ProtoField(2, ScalarType.UINT64),
|
||||
time: ProtoField(4, ScalarType.UINT32),
|
||||
type: ProtoField(5, ScalarType.UINT32),
|
||||
|
||||
|
@@ -1,3 +1,4 @@
|
||||
import { GroupNotifyMsgStatus } from '@/core';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { ActionName } from '../types';
|
||||
|
||||
@@ -11,18 +12,22 @@ export default class GetGroupAddRequest extends BaseAction<null, OB11GroupReques
|
||||
actionName = ActionName.GetGroupIgnoreAddRequest;
|
||||
|
||||
async _handle(payload: null): Promise<OB11GroupRequestNotify[] | null> {
|
||||
// const data = await this.core.apis.GroupApi.getGroupIgnoreNotifies();
|
||||
// log(data);
|
||||
// const notifies: GroupNotify[] = data.notifies.filter(notify => notify.status === GroupNotifyStatus.WAIT_HANDLE);
|
||||
// const returnData: OB11GroupRequestNotify[] = [];
|
||||
// for (const notify of notifies) {
|
||||
// const uin = || (await NTQQUserApi.getUserDetailInfo(notify.user1.uid))?.uin;
|
||||
// returnData.push({
|
||||
// group_id: parseInt(notify.group.groupCode),
|
||||
// user_id: parseInt(uin),
|
||||
// flag: notify.seq
|
||||
// });
|
||||
// }
|
||||
return null;
|
||||
const ignoredNotifies = await this.core.apis.GroupApi.getSingleScreenNotifies(true, 10);
|
||||
const retData: any = {
|
||||
join_requests: await Promise.all(
|
||||
ignoredNotifies
|
||||
.filter(notify => notify.type === 7)
|
||||
.map(async SSNotify => ({
|
||||
request_id: SSNotify.seq,
|
||||
requester_uin: await this.core.apis.UserApi.getUinByUidV2(SSNotify.user1?.uid),
|
||||
requester_nick: SSNotify.user1?.nickName,
|
||||
group_id: SSNotify.group?.groupCode,
|
||||
group_name: SSNotify.group?.groupName,
|
||||
checked: SSNotify.status !== GroupNotifyMsgStatus.KUNHANDLE,
|
||||
actor: await this.core.apis.UserApi.getUinByUidV2(SSNotify.user2?.uid) || 0,
|
||||
}))),
|
||||
};
|
||||
|
||||
return retData;
|
||||
}
|
||||
}
|
||||
|
@@ -59,7 +59,7 @@ export enum ActionName {
|
||||
// QidianGetAccountInfo = 'qidian_get_account_info',
|
||||
// GetModelShow = '_get_model_show',
|
||||
// SetModelShow = '_set_model_show',
|
||||
// GetOnlineClient = 'get_online_clients',
|
||||
GetOnlineClient = 'get_online_clients',
|
||||
// GetUnidirectionalFriendList = 'get_unidirectional_friend_list',
|
||||
// DeleteFriend = 'delete_friend',
|
||||
// DeleteUnidirectionalFriendList = 'delete_unidirectional_friend',
|
||||
@@ -135,12 +135,10 @@ export enum ActionName {
|
||||
GetRkey = 'nc_get_rkey',
|
||||
GetGroupShutList = 'get_group_shut_list',
|
||||
|
||||
// GetGroupIgnoreAddRequest = 'get_group_ignore_add_request',
|
||||
// GetConfig = 'get_config',
|
||||
// SetConfig = 'set_config',
|
||||
GetGuildList = 'get_guild_list',
|
||||
GetGuildProfile = 'get_guild_service_profile',
|
||||
GetGroupIgnoreAddRequest = 'get_group_ignore_add_request',
|
||||
// Debug = 'debug',
|
||||
// GetGuildList = 'get_guild_list',
|
||||
// TestApi01 = 'test_api_01',
|
||||
// GetGuildProfile = 'get_guild_service_profile',
|
||||
// UploadForwardMsg = "upload_forward_msg",
|
||||
}
|
||||
|
@@ -30,7 +30,7 @@ async function onSettingWindowCreated(view: Element) {
|
||||
SettingItem(
|
||||
'<span id="napcat-update-title">Napcat</span>',
|
||||
undefined,
|
||||
SettingButton('V3.1.1', 'napcat-update-button', 'secondary'),
|
||||
SettingButton('V3.1.3', 'napcat-update-button', 'secondary'),
|
||||
),
|
||||
]),
|
||||
SettingList([
|
||||
|
@@ -164,7 +164,7 @@ async function onSettingWindowCreated(view) {
|
||||
SettingItem(
|
||||
'<span id="napcat-update-title">Napcat</span>',
|
||||
void 0,
|
||||
SettingButton("V3.1.1", "napcat-update-button", "secondary")
|
||||
SettingButton("V3.1.3", "napcat-update-button", "secondary")
|
||||
)
|
||||
]),
|
||||
SettingList([
|
||||
|
Reference in New Issue
Block a user