mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
fix: filter emoji un-like by operation
This commit is contained in:
parent
b4ec1ad6c0
commit
53475a6a0e
@ -19,6 +19,13 @@ message EmojiLikeToOthersMsgSpec {
|
||||
}
|
||||
|
||||
message EmojiLikeToOthersAttributes {
|
||||
enum Operation {
|
||||
FALLBACK = 0;
|
||||
LIKE = 1;
|
||||
UNLIKE = 2;
|
||||
}
|
||||
|
||||
string emojiId = 1;
|
||||
string senderUid = 4;
|
||||
Operation operation = 5;
|
||||
}
|
||||
|
@ -62,6 +62,27 @@ export interface EmojiLikeToOthersAttributes {
|
||||
* @generated from protobuf field: string senderUid = 4;
|
||||
*/
|
||||
senderUid: string;
|
||||
/**
|
||||
* @generated from protobuf field: SysMessage.EmojiLikeToOthersAttributes.Operation operation = 5;
|
||||
*/
|
||||
operation: EmojiLikeToOthersAttributes_Operation;
|
||||
}
|
||||
/**
|
||||
* @generated from protobuf enum SysMessage.EmojiLikeToOthersAttributes.Operation
|
||||
*/
|
||||
export enum EmojiLikeToOthersAttributes_Operation {
|
||||
/**
|
||||
* @generated from protobuf enum value: FALLBACK = 0;
|
||||
*/
|
||||
FALLBACK = 0,
|
||||
/**
|
||||
* @generated from protobuf enum value: LIKE = 1;
|
||||
*/
|
||||
LIKE = 1,
|
||||
/**
|
||||
* @generated from protobuf enum value: UNLIKE = 2;
|
||||
*/
|
||||
UNLIKE = 2
|
||||
}
|
||||
// @generated message type with reflection information, may provide speed optimized methods
|
||||
class EmojiLikeToOthersWrapper1$Type extends MessageType<EmojiLikeToOthersWrapper1> {
|
||||
@ -260,13 +281,15 @@ class EmojiLikeToOthersAttributes$Type extends MessageType<EmojiLikeToOthersAttr
|
||||
constructor() {
|
||||
super("SysMessage.EmojiLikeToOthersAttributes", [
|
||||
{ no: 1, name: "emojiId", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
||||
{ no: 4, name: "senderUid", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
||||
{ no: 4, name: "senderUid", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
||||
{ no: 5, name: "operation", kind: "enum", T: () => ["SysMessage.EmojiLikeToOthersAttributes.Operation", EmojiLikeToOthersAttributes_Operation] }
|
||||
]);
|
||||
}
|
||||
create(value?: PartialMessage<EmojiLikeToOthersAttributes>): EmojiLikeToOthersAttributes {
|
||||
const message = globalThis.Object.create((this.messagePrototype!));
|
||||
message.emojiId = "";
|
||||
message.senderUid = "";
|
||||
message.operation = 0;
|
||||
if (value !== undefined)
|
||||
reflectionMergePartial<EmojiLikeToOthersAttributes>(this, message, value);
|
||||
return message;
|
||||
@ -282,6 +305,9 @@ class EmojiLikeToOthersAttributes$Type extends MessageType<EmojiLikeToOthersAttr
|
||||
case /* string senderUid */ 4:
|
||||
message.senderUid = reader.string();
|
||||
break;
|
||||
case /* SysMessage.EmojiLikeToOthersAttributes.Operation operation */ 5:
|
||||
message.operation = reader.int32();
|
||||
break;
|
||||
default:
|
||||
let u = options.readUnknownField;
|
||||
if (u === "throw")
|
||||
@ -300,6 +326,9 @@ class EmojiLikeToOthersAttributes$Type extends MessageType<EmojiLikeToOthersAttr
|
||||
/* string senderUid = 4; */
|
||||
if (message.senderUid !== "")
|
||||
writer.tag(4, WireType.LengthDelimited).string(message.senderUid);
|
||||
/* SysMessage.EmojiLikeToOthersAttributes.Operation operation = 5; */
|
||||
if (message.operation !== 0)
|
||||
writer.tag(5, WireType.Varint).int32(message.operation);
|
||||
let u = options.writeUnknownFields;
|
||||
if (u !== false)
|
||||
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||
|
@ -255,6 +255,9 @@ export class NapCatOneBot11Adapter {
|
||||
.fromBinary(greyTip.rest)
|
||||
.wrapper!
|
||||
.body!;
|
||||
if (emojiLikeToOthers.attributes?.operation !== 1) { // Un-like
|
||||
return;
|
||||
}
|
||||
const eventOrEmpty = await this.apis.GroupApi.createGroupEmojiLikeEvent(
|
||||
greyTip.groupCode.toString(),
|
||||
await this.core.apis.UserApi.getUinByUidV2(emojiLikeToOthers.attributes!.senderUid),
|
||||
|
Loading…
x
Reference in New Issue
Block a user