From 46e4b4640fb53bce10d76d877a0a9d802ac9c3ab Mon Sep 17 00:00:00 2001 From: itzaname Date: Sat, 21 Jun 2025 07:36:41 +0000 Subject: [PATCH] Autogenerated update for https://git.itzana.me/StrafesNET/protobufs/compare/a8135fd45c05e945b68a3a9576881179044142ea...b5b8cc5413b6c96b67e911a9c644956d655c235c --- moderation/moderation.pb.go | 195 ++++++++++++++++++++++++++----- moderation/moderation_grpc.pb.go | 36 ++++++ 2 files changed, 203 insertions(+), 28 deletions(-) diff --git a/moderation/moderation.pb.go b/moderation/moderation.pb.go index 1a926d1..24cfd7c 100644 --- a/moderation/moderation.pb.go +++ b/moderation/moderation.pb.go @@ -9,6 +9,7 @@ package moderation import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + structpb "google.golang.org/protobuf/types/known/structpb" reflect "reflect" sync "sync" ) @@ -129,29 +130,149 @@ func (x *SetStateRequest) GetStateID() int32 { return 0 } +type SetMuteRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserID int64 `protobuf:"varint,1,opt,name=UserID,proto3" json:"UserID,omitempty"` + ModeratorID int64 `protobuf:"varint,2,opt,name=ModeratorID,proto3" json:"ModeratorID,omitempty"` + Muted bool `protobuf:"varint,3,opt,name=Muted,proto3" json:"Muted,omitempty"` + Duration *int64 `protobuf:"varint,4,opt,name=Duration,proto3,oneof" json:"Duration,omitempty"` + ReasonID *int32 `protobuf:"varint,5,opt,name=ReasonID,proto3,oneof" json:"ReasonID,omitempty"` + ReasonText *string `protobuf:"bytes,6,opt,name=ReasonText,proto3,oneof" json:"ReasonText,omitempty"` + Metadata *structpb.Struct `protobuf:"bytes,7,opt,name=Metadata,proto3,oneof" json:"Metadata,omitempty"` +} + +func (x *SetMuteRequest) Reset() { + *x = SetMuteRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_moderation_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetMuteRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetMuteRequest) ProtoMessage() {} + +func (x *SetMuteRequest) ProtoReflect() protoreflect.Message { + mi := &file_moderation_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetMuteRequest.ProtoReflect.Descriptor instead. +func (*SetMuteRequest) Descriptor() ([]byte, []int) { + return file_moderation_proto_rawDescGZIP(), []int{2} +} + +func (x *SetMuteRequest) GetUserID() int64 { + if x != nil { + return x.UserID + } + return 0 +} + +func (x *SetMuteRequest) GetModeratorID() int64 { + if x != nil { + return x.ModeratorID + } + return 0 +} + +func (x *SetMuteRequest) GetMuted() bool { + if x != nil { + return x.Muted + } + return false +} + +func (x *SetMuteRequest) GetDuration() int64 { + if x != nil && x.Duration != nil { + return *x.Duration + } + return 0 +} + +func (x *SetMuteRequest) GetReasonID() int32 { + if x != nil && x.ReasonID != nil { + return *x.ReasonID + } + return 0 +} + +func (x *SetMuteRequest) GetReasonText() string { + if x != nil && x.ReasonText != nil { + return *x.ReasonText + } + return "" +} + +func (x *SetMuteRequest) GetMetadata() *structpb.Struct { + if x != nil { + return x.Metadata + } + return nil +} + var File_moderation_proto protoreflect.FileDescriptor var file_moderation_proto_rawDesc = []byte{ 0x0a, 0x10, 0x6d, 0x6f, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x06, - 0x0a, 0x04, 0x4e, 0x75, 0x6c, 0x6c, 0x22, 0x81, 0x01, 0x0a, 0x0f, 0x53, 0x65, 0x74, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, - 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, - 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x4d, 0x6f, 0x64, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, - 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x4d, 0x6f, 0x64, 0x65, 0x72, 0x61, 0x74, - 0x6f, 0x72, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x44, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x44, - 0x12, 0x18, 0x0a, 0x07, 0x53, 0x74, 0x61, 0x74, 0x65, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x07, 0x53, 0x74, 0x61, 0x74, 0x65, 0x49, 0x44, 0x32, 0x4e, 0x0a, 0x11, 0x4d, 0x6f, - 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x39, 0x0a, 0x08, 0x53, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1b, 0x2e, 0x6d, 0x6f, - 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4e, 0x75, 0x6c, 0x6c, 0x42, 0x2d, 0x5a, 0x2b, 0x67, 0x69, - 0x74, 0x2e, 0x69, 0x74, 0x7a, 0x61, 0x6e, 0x61, 0x2e, 0x6d, 0x65, 0x2f, 0x73, 0x74, 0x72, 0x61, - 0x66, 0x65, 0x73, 0x6e, 0x65, 0x74, 0x2f, 0x67, 0x6f, 0x2d, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x6d, - 0x6f, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x74, 0x6f, 0x12, 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x1c, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, + 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x06, 0x0a, 0x04, + 0x4e, 0x75, 0x6c, 0x6c, 0x22, 0x81, 0x01, 0x0a, 0x0f, 0x53, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, + 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, + 0x12, 0x20, 0x0a, 0x0b, 0x4d, 0x6f, 0x64, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x44, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x4d, 0x6f, 0x64, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, + 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x18, + 0x0a, 0x07, 0x53, 0x74, 0x61, 0x74, 0x65, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x53, 0x74, 0x61, 0x74, 0x65, 0x49, 0x44, 0x22, 0xb7, 0x02, 0x0a, 0x0e, 0x53, 0x65, 0x74, + 0x4d, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x55, + 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x4d, 0x6f, 0x64, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, + 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x4d, 0x6f, 0x64, 0x65, 0x72, 0x61, + 0x74, 0x6f, 0x72, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, 0x4d, 0x75, 0x74, 0x65, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x4d, 0x75, 0x74, 0x65, 0x64, 0x12, 0x1f, 0x0a, 0x08, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, + 0x08, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08, + 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x48, 0x01, + 0x52, 0x08, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x44, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, + 0x0a, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x54, 0x65, 0x78, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x02, 0x52, 0x0a, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x54, 0x65, 0x78, 0x74, 0x88, + 0x01, 0x01, 0x12, 0x38, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x48, 0x03, 0x52, + 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, + 0x5f, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x52, 0x65, + 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x44, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x52, 0x65, 0x61, 0x73, 0x6f, + 0x6e, 0x54, 0x65, 0x78, 0x74, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x32, 0x88, 0x01, 0x0a, 0x11, 0x4d, 0x6f, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x39, 0x0a, 0x08, 0x53, 0x65, 0x74, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x12, 0x1b, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x53, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x10, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4e, + 0x75, 0x6c, 0x6c, 0x12, 0x38, 0x0a, 0x08, 0x53, 0x65, 0x74, 0x4d, 0x75, 0x74, 0x65, 0x64, 0x12, + 0x1a, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x74, + 0x4d, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x6d, 0x6f, + 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4e, 0x75, 0x6c, 0x6c, 0x42, 0x2d, 0x5a, + 0x2b, 0x67, 0x69, 0x74, 0x2e, 0x69, 0x74, 0x7a, 0x61, 0x6e, 0x61, 0x2e, 0x6d, 0x65, 0x2f, 0x73, + 0x74, 0x72, 0x61, 0x66, 0x65, 0x73, 0x6e, 0x65, 0x74, 0x2f, 0x67, 0x6f, 0x2d, 0x67, 0x72, 0x70, + 0x63, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -166,19 +287,24 @@ func file_moderation_proto_rawDescGZIP() []byte { return file_moderation_proto_rawDescData } -var file_moderation_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_moderation_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_moderation_proto_goTypes = []interface{}{ (*Null)(nil), // 0: moderation.Null (*SetStateRequest)(nil), // 1: moderation.SetStateRequest + (*SetMuteRequest)(nil), // 2: moderation.SetMuteRequest + (*structpb.Struct)(nil), // 3: google.protobuf.Struct } var file_moderation_proto_depIdxs = []int32{ - 1, // 0: moderation.ModerationService.SetState:input_type -> moderation.SetStateRequest - 0, // 1: moderation.ModerationService.SetState:output_type -> moderation.Null - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 3, // 0: moderation.SetMuteRequest.Metadata:type_name -> google.protobuf.Struct + 1, // 1: moderation.ModerationService.SetState:input_type -> moderation.SetStateRequest + 2, // 2: moderation.ModerationService.SetMuted:input_type -> moderation.SetMuteRequest + 0, // 3: moderation.ModerationService.SetState:output_type -> moderation.Null + 0, // 4: moderation.ModerationService.SetMuted:output_type -> moderation.Null + 3, // [3:5] is the sub-list for method output_type + 1, // [1:3] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_moderation_proto_init() } @@ -211,14 +337,27 @@ func file_moderation_proto_init() { return nil } } + file_moderation_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetMuteRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } + file_moderation_proto_msgTypes[2].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_moderation_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 3, NumExtensions: 0, NumServices: 1, }, diff --git a/moderation/moderation_grpc.pb.go b/moderation/moderation_grpc.pb.go index fbe7278..f716962 100644 --- a/moderation/moderation_grpc.pb.go +++ b/moderation/moderation_grpc.pb.go @@ -23,6 +23,7 @@ const _ = grpc.SupportPackageIsVersion7 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type ModerationServiceClient interface { SetState(ctx context.Context, in *SetStateRequest, opts ...grpc.CallOption) (*Null, error) + SetMuted(ctx context.Context, in *SetMuteRequest, opts ...grpc.CallOption) (*Null, error) } type moderationServiceClient struct { @@ -42,11 +43,21 @@ func (c *moderationServiceClient) SetState(ctx context.Context, in *SetStateRequ return out, nil } +func (c *moderationServiceClient) SetMuted(ctx context.Context, in *SetMuteRequest, opts ...grpc.CallOption) (*Null, error) { + out := new(Null) + err := c.cc.Invoke(ctx, "/moderation.ModerationService/SetMuted", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // ModerationServiceServer is the server API for ModerationService service. // All implementations must embed UnimplementedModerationServiceServer // for forward compatibility type ModerationServiceServer interface { SetState(context.Context, *SetStateRequest) (*Null, error) + SetMuted(context.Context, *SetMuteRequest) (*Null, error) mustEmbedUnimplementedModerationServiceServer() } @@ -57,6 +68,9 @@ type UnimplementedModerationServiceServer struct { func (UnimplementedModerationServiceServer) SetState(context.Context, *SetStateRequest) (*Null, error) { return nil, status.Errorf(codes.Unimplemented, "method SetState not implemented") } +func (UnimplementedModerationServiceServer) SetMuted(context.Context, *SetMuteRequest) (*Null, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetMuted not implemented") +} func (UnimplementedModerationServiceServer) mustEmbedUnimplementedModerationServiceServer() {} // UnsafeModerationServiceServer may be embedded to opt out of forward compatibility for this service. @@ -88,6 +102,24 @@ func _ModerationService_SetState_Handler(srv interface{}, ctx context.Context, d return interceptor(ctx, in, info, handler) } +func _ModerationService_SetMuted_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetMuteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModerationServiceServer).SetMuted(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/moderation.ModerationService/SetMuted", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModerationServiceServer).SetMuted(ctx, req.(*SetMuteRequest)) + } + return interceptor(ctx, in, info, handler) +} + // ModerationService_ServiceDesc is the grpc.ServiceDesc for ModerationService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -99,6 +131,10 @@ var ModerationService_ServiceDesc = grpc.ServiceDesc{ MethodName: "SetState", Handler: _ModerationService_SetState_Handler, }, + { + MethodName: "SetMuted", + Handler: _ModerationService_SetMuted_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "moderation.proto",