junexbaileys 1.1.6 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/WAProto/WAProto.proto +9 -0
- package/WAProto/index.d.ts +26 -0
- package/WAProto/index.js +207 -0
- package/lib/Defaults/index.d.ts +3 -0
- package/lib/Defaults/index.d.ts.map +1 -1
- package/lib/Defaults/index.js +11 -0
- package/lib/Defaults/index.js.map +1 -1
- package/lib/Socket/business.d.ts +24 -0
- package/lib/Socket/business.d.ts.map +1 -1
- package/lib/Socket/channelPollVote.d.ts +44 -0
- package/lib/Socket/channelPollVote.d.ts.map +1 -0
- package/lib/Socket/channelPollVote.js +65 -0
- package/lib/Socket/channelPollVote.js.map +1 -0
- package/lib/Socket/channelSchedule.d.ts +229 -0
- package/lib/Socket/channelSchedule.d.ts.map +1 -0
- package/lib/Socket/channelSchedule.js +462 -0
- package/lib/Socket/channelSchedule.js.map +1 -0
- package/lib/Socket/channelStatus.d.ts +223 -0
- package/lib/Socket/channelStatus.d.ts.map +1 -1
- package/lib/Socket/channelStatus.js +312 -1
- package/lib/Socket/channelStatus.js.map +1 -1
- package/lib/Socket/chats.d.ts +1 -0
- package/lib/Socket/chats.d.ts.map +1 -1
- package/lib/Socket/chats.js +1 -0
- package/lib/Socket/chats.js.map +1 -1
- package/lib/Socket/communities.d.ts +24 -0
- package/lib/Socket/communities.d.ts.map +1 -1
- package/lib/Socket/groups.d.ts +1 -0
- package/lib/Socket/groups.d.ts.map +1 -1
- package/lib/Socket/index.d.ts +24 -0
- package/lib/Socket/index.d.ts.map +1 -1
- package/lib/Socket/messages-recv.d.ts +24 -0
- package/lib/Socket/messages-recv.d.ts.map +1 -1
- package/lib/Socket/messages-send.d.ts +35 -4
- package/lib/Socket/messages-send.d.ts.map +1 -1
- package/lib/Socket/messages-send.js +99 -3
- package/lib/Socket/messages-send.js.map +1 -1
- package/lib/Socket/mex.d.ts +9 -1
- package/lib/Socket/mex.d.ts.map +1 -1
- package/lib/Socket/mex.js +199 -2
- package/lib/Socket/mex.js.map +1 -1
- package/lib/Socket/newsletter.d.ts +1 -0
- package/lib/Socket/newsletter.d.ts.map +1 -1
- package/lib/Socket/newsletter.js +22 -20
- package/lib/Socket/newsletter.js.map +1 -1
- package/lib/Socket/newsletterDirectory.d.ts +201 -0
- package/lib/Socket/newsletterDirectory.d.ts.map +1 -0
- package/lib/Socket/newsletterDirectory.js +296 -0
- package/lib/Socket/newsletterDirectory.js.map +1 -0
- package/lib/Types/Message.d.ts +32 -2
- package/lib/Types/Message.d.ts.map +1 -1
- package/lib/Utils/messages-media.d.ts +4 -0
- package/lib/Utils/messages-media.d.ts.map +1 -1
- package/lib/Utils/messages-media.js +14 -5
- package/lib/Utils/messages-media.js.map +1 -1
- package/lib/Utils/messages.d.ts +18 -1
- package/lib/Utils/messages.d.ts.map +1 -1
- package/lib/Utils/messages.js +168 -16
- package/lib/Utils/messages.js.map +1 -1
- package/lib/Utils/process-message.d.ts +18 -0
- package/lib/Utils/process-message.d.ts.map +1 -1
- package/lib/Utils/process-message.js +43 -1
- package/lib/Utils/process-message.js.map +1 -1
- package/lib/WABinary/jid-utils.d.ts +2 -0
- package/lib/WABinary/jid-utils.d.ts.map +1 -1
- package/lib/WABinary/jid-utils.js +5 -0
- package/lib/WABinary/jid-utils.js.map +1 -1
- package/package.json +1 -1
package/WAProto/WAProto.proto
CHANGED
|
@@ -2157,6 +2157,7 @@ message Message {
|
|
|
2157
2157
|
optional StatusQuotedMessage statusQuotedMessage = 109;
|
|
2158
2158
|
optional StatusStickerInteractionMessage statusStickerInteractionMessage = 110;
|
|
2159
2159
|
optional PollCreationMessage pollCreationMessageV5 = 111;
|
|
2160
|
+
optional PollAddOptionMessage pollAddOptionMessage = 121;
|
|
2160
2161
|
optional NewsletterFollowerInviteMessage newsletterFollowerInviteMessageV2 = 113;
|
|
2161
2162
|
optional PollResultSnapshotMessage pollResultSnapshotMessageV3 = 114;
|
|
2162
2163
|
message AlbumMessage {
|
|
@@ -3236,6 +3237,9 @@ message Message {
|
|
|
3236
3237
|
optional Message.PollContentType pollContentType = 6;
|
|
3237
3238
|
optional Message.PollType pollType = 7;
|
|
3238
3239
|
optional Option correctAnswer = 8;
|
|
3240
|
+
optional int64 endTime = 9;
|
|
3241
|
+
optional bool hideParticipantName = 10;
|
|
3242
|
+
optional bool allowAddOption = 11;
|
|
3239
3243
|
message Option {
|
|
3240
3244
|
optional string optionName = 1;
|
|
3241
3245
|
optional string optionHash = 2;
|
|
@@ -3271,6 +3275,11 @@ message Message {
|
|
|
3271
3275
|
optional int64 senderTimestampMs = 4;
|
|
3272
3276
|
}
|
|
3273
3277
|
|
|
3278
|
+
message PollAddOptionMessage {
|
|
3279
|
+
optional MessageKey pollCreationMessageKey = 1;
|
|
3280
|
+
optional PollCreationMessage.Option addOption = 2;
|
|
3281
|
+
}
|
|
3282
|
+
|
|
3274
3283
|
message PollUpdateMessageMetadata {
|
|
3275
3284
|
}
|
|
3276
3285
|
|
package/WAProto/index.d.ts
CHANGED
|
@@ -5276,6 +5276,7 @@ export namespace proto {
|
|
|
5276
5276
|
statusQuotedMessage?: (proto.Message.IStatusQuotedMessage|null);
|
|
5277
5277
|
statusStickerInteractionMessage?: (proto.Message.IStatusStickerInteractionMessage|null);
|
|
5278
5278
|
pollCreationMessageV5?: (proto.Message.IPollCreationMessage|null);
|
|
5279
|
+
pollAddOptionMessage?: (proto.Message.IPollAddOptionMessage|null);
|
|
5279
5280
|
newsletterFollowerInviteMessageV2?: (proto.Message.INewsletterFollowerInviteMessage|null);
|
|
5280
5281
|
pollResultSnapshotMessageV3?: (proto.Message.IPollResultSnapshotMessage|null);
|
|
5281
5282
|
}
|
|
@@ -5375,6 +5376,7 @@ export namespace proto {
|
|
|
5375
5376
|
public statusQuotedMessage?: (proto.Message.IStatusQuotedMessage|null);
|
|
5376
5377
|
public statusStickerInteractionMessage?: (proto.Message.IStatusStickerInteractionMessage|null);
|
|
5377
5378
|
public pollCreationMessageV5?: (proto.Message.IPollCreationMessage|null);
|
|
5379
|
+
public pollAddOptionMessage?: (proto.Message.IPollAddOptionMessage|null);
|
|
5378
5380
|
public newsletterFollowerInviteMessageV2?: (proto.Message.INewsletterFollowerInviteMessage|null);
|
|
5379
5381
|
public pollResultSnapshotMessageV3?: (proto.Message.IPollResultSnapshotMessage|null);
|
|
5380
5382
|
public static create(properties?: proto.IMessage): proto.Message;
|
|
@@ -8306,6 +8308,9 @@ export namespace proto {
|
|
|
8306
8308
|
pollContentType?: (proto.Message.PollContentType|null);
|
|
8307
8309
|
pollType?: (proto.Message.PollType|null);
|
|
8308
8310
|
correctAnswer?: (proto.Message.PollCreationMessage.IOption|null);
|
|
8311
|
+
endTime?: (number|Long|null);
|
|
8312
|
+
hideParticipantName?: (boolean|null);
|
|
8313
|
+
allowAddOption?: (boolean|null);
|
|
8309
8314
|
}
|
|
8310
8315
|
|
|
8311
8316
|
class PollCreationMessage implements IPollCreationMessage {
|
|
@@ -8318,6 +8323,9 @@ export namespace proto {
|
|
|
8318
8323
|
public pollContentType?: (proto.Message.PollContentType|null);
|
|
8319
8324
|
public pollType?: (proto.Message.PollType|null);
|
|
8320
8325
|
public correctAnswer?: (proto.Message.PollCreationMessage.IOption|null);
|
|
8326
|
+
public endTime?: (number|Long|null);
|
|
8327
|
+
public hideParticipantName?: (boolean|null);
|
|
8328
|
+
public allowAddOption?: (boolean|null);
|
|
8321
8329
|
public static create(properties?: proto.Message.IPollCreationMessage): proto.Message.PollCreationMessage;
|
|
8322
8330
|
public static encode(m: proto.Message.IPollCreationMessage, w?: $protobuf.Writer): $protobuf.Writer;
|
|
8323
8331
|
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PollCreationMessage;
|
|
@@ -8436,6 +8444,24 @@ export namespace proto {
|
|
|
8436
8444
|
public static getTypeUrl(typeUrlPrefix?: string): string;
|
|
8437
8445
|
}
|
|
8438
8446
|
|
|
8447
|
+
interface IPollAddOptionMessage {
|
|
8448
|
+
pollCreationMessageKey?: (proto.IMessageKey|null);
|
|
8449
|
+
addOption?: (proto.Message.PollCreationMessage.IOption|null);
|
|
8450
|
+
}
|
|
8451
|
+
|
|
8452
|
+
class PollAddOptionMessage implements IPollAddOptionMessage {
|
|
8453
|
+
constructor(p?: proto.Message.IPollAddOptionMessage);
|
|
8454
|
+
public pollCreationMessageKey?: (proto.IMessageKey|null);
|
|
8455
|
+
public addOption?: (proto.Message.PollCreationMessage.IOption|null);
|
|
8456
|
+
public static create(properties?: proto.Message.IPollAddOptionMessage): proto.Message.PollAddOptionMessage;
|
|
8457
|
+
public static encode(m: proto.Message.IPollAddOptionMessage, w?: $protobuf.Writer): $protobuf.Writer;
|
|
8458
|
+
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.PollAddOptionMessage;
|
|
8459
|
+
public static fromObject(d: { [k: string]: any }): proto.Message.PollAddOptionMessage;
|
|
8460
|
+
public static toObject(m: proto.Message.PollAddOptionMessage, o?: $protobuf.IConversionOptions): { [k: string]: any };
|
|
8461
|
+
public toJSON(): { [k: string]: any };
|
|
8462
|
+
public static getTypeUrl(typeUrlPrefix?: string): string;
|
|
8463
|
+
}
|
|
8464
|
+
|
|
8439
8465
|
interface IPollUpdateMessageMetadata {
|
|
8440
8466
|
}
|
|
8441
8467
|
|
package/WAProto/index.js
CHANGED
|
@@ -35561,6 +35561,7 @@ export const proto = $root.proto = (() => {
|
|
|
35561
35561
|
Message.prototype.pollCreationMessageV5 = null;
|
|
35562
35562
|
Message.prototype.newsletterFollowerInviteMessageV2 = null;
|
|
35563
35563
|
Message.prototype.pollResultSnapshotMessageV3 = null;
|
|
35564
|
+
Message.prototype.pollAddOptionMessage = null;
|
|
35564
35565
|
|
|
35565
35566
|
let $oneOfFields;
|
|
35566
35567
|
|
|
@@ -36134,6 +36135,12 @@ export const proto = $root.proto = (() => {
|
|
|
36134
36135
|
set: $util.oneOfSetter($oneOfFields)
|
|
36135
36136
|
});
|
|
36136
36137
|
|
|
36138
|
+
// Virtual OneOf for proto3 optional field
|
|
36139
|
+
Object.defineProperty(Message.prototype, "_pollAddOptionMessage", {
|
|
36140
|
+
get: $util.oneOfGetter($oneOfFields = ["pollAddOptionMessage"]),
|
|
36141
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
36142
|
+
});
|
|
36143
|
+
|
|
36137
36144
|
Message.create = function create(properties) {
|
|
36138
36145
|
return new Message(properties);
|
|
36139
36146
|
};
|
|
@@ -36331,6 +36338,8 @@ export const proto = $root.proto = (() => {
|
|
|
36331
36338
|
$root.proto.Message.NewsletterFollowerInviteMessage.encode(m.newsletterFollowerInviteMessageV2, w.uint32(906).fork()).ldelim();
|
|
36332
36339
|
if (m.pollResultSnapshotMessageV3 != null && Object.hasOwnProperty.call(m, "pollResultSnapshotMessageV3"))
|
|
36333
36340
|
$root.proto.Message.PollResultSnapshotMessage.encode(m.pollResultSnapshotMessageV3, w.uint32(914).fork()).ldelim();
|
|
36341
|
+
if (m.pollAddOptionMessage != null && Object.hasOwnProperty.call(m, "pollAddOptionMessage"))
|
|
36342
|
+
$root.proto.Message.PollAddOptionMessage.encode(m.pollAddOptionMessage, w.uint32(970).fork()).ldelim();
|
|
36334
36343
|
return w;
|
|
36335
36344
|
};
|
|
36336
36345
|
|
|
@@ -36723,6 +36732,10 @@ export const proto = $root.proto = (() => {
|
|
|
36723
36732
|
m.pollResultSnapshotMessageV3 = $root.proto.Message.PollResultSnapshotMessage.decode(r, r.uint32());
|
|
36724
36733
|
break;
|
|
36725
36734
|
}
|
|
36735
|
+
case 121: {
|
|
36736
|
+
m.pollAddOptionMessage = $root.proto.Message.PollAddOptionMessage.decode(r, r.uint32());
|
|
36737
|
+
break;
|
|
36738
|
+
}
|
|
36726
36739
|
default:
|
|
36727
36740
|
r.skipType(t & 7);
|
|
36728
36741
|
break;
|
|
@@ -37208,6 +37221,11 @@ export const proto = $root.proto = (() => {
|
|
|
37208
37221
|
throw TypeError(".proto.Message.pollResultSnapshotMessageV3: object expected");
|
|
37209
37222
|
m.pollResultSnapshotMessageV3 = $root.proto.Message.PollResultSnapshotMessage.fromObject(d.pollResultSnapshotMessageV3);
|
|
37210
37223
|
}
|
|
37224
|
+
if (d.pollAddOptionMessage != null) {
|
|
37225
|
+
if (typeof d.pollAddOptionMessage !== "object")
|
|
37226
|
+
throw TypeError(".proto.Message.pollAddOptionMessage: object expected");
|
|
37227
|
+
m.pollAddOptionMessage = $root.proto.Message.PollAddOptionMessage.fromObject(d.pollAddOptionMessage);
|
|
37228
|
+
}
|
|
37211
37229
|
return m;
|
|
37212
37230
|
};
|
|
37213
37231
|
|
|
@@ -37690,6 +37708,11 @@ export const proto = $root.proto = (() => {
|
|
|
37690
37708
|
if (o.oneofs)
|
|
37691
37709
|
d._pollResultSnapshotMessageV3 = "pollResultSnapshotMessageV3";
|
|
37692
37710
|
}
|
|
37711
|
+
if (m.pollAddOptionMessage != null && m.hasOwnProperty("pollAddOptionMessage")) {
|
|
37712
|
+
d.pollAddOptionMessage = $root.proto.Message.PollAddOptionMessage.toObject(m.pollAddOptionMessage, o);
|
|
37713
|
+
if (o.oneofs)
|
|
37714
|
+
d._pollAddOptionMessage = "pollAddOptionMessage";
|
|
37715
|
+
}
|
|
37693
37716
|
return d;
|
|
37694
37717
|
};
|
|
37695
37718
|
|
|
@@ -57979,6 +58002,9 @@ export const proto = $root.proto = (() => {
|
|
|
57979
58002
|
PollCreationMessage.prototype.pollContentType = null;
|
|
57980
58003
|
PollCreationMessage.prototype.pollType = null;
|
|
57981
58004
|
PollCreationMessage.prototype.correctAnswer = null;
|
|
58005
|
+
PollCreationMessage.prototype.endTime = null;
|
|
58006
|
+
PollCreationMessage.prototype.hideParticipantName = null;
|
|
58007
|
+
PollCreationMessage.prototype.allowAddOption = null;
|
|
57982
58008
|
|
|
57983
58009
|
let $oneOfFields;
|
|
57984
58010
|
|
|
@@ -58024,6 +58050,24 @@ export const proto = $root.proto = (() => {
|
|
|
58024
58050
|
set: $util.oneOfSetter($oneOfFields)
|
|
58025
58051
|
});
|
|
58026
58052
|
|
|
58053
|
+
// Virtual OneOf for proto3 optional field
|
|
58054
|
+
Object.defineProperty(PollCreationMessage.prototype, "_endTime", {
|
|
58055
|
+
get: $util.oneOfGetter($oneOfFields = ["endTime"]),
|
|
58056
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
58057
|
+
});
|
|
58058
|
+
|
|
58059
|
+
// Virtual OneOf for proto3 optional field
|
|
58060
|
+
Object.defineProperty(PollCreationMessage.prototype, "_hideParticipantName", {
|
|
58061
|
+
get: $util.oneOfGetter($oneOfFields = ["hideParticipantName"]),
|
|
58062
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
58063
|
+
});
|
|
58064
|
+
|
|
58065
|
+
// Virtual OneOf for proto3 optional field
|
|
58066
|
+
Object.defineProperty(PollCreationMessage.prototype, "_allowAddOption", {
|
|
58067
|
+
get: $util.oneOfGetter($oneOfFields = ["allowAddOption"]),
|
|
58068
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
58069
|
+
});
|
|
58070
|
+
|
|
58027
58071
|
PollCreationMessage.create = function create(properties) {
|
|
58028
58072
|
return new PollCreationMessage(properties);
|
|
58029
58073
|
};
|
|
@@ -58049,6 +58093,12 @@ export const proto = $root.proto = (() => {
|
|
|
58049
58093
|
w.uint32(56).int32(m.pollType);
|
|
58050
58094
|
if (m.correctAnswer != null && Object.hasOwnProperty.call(m, "correctAnswer"))
|
|
58051
58095
|
$root.proto.Message.PollCreationMessage.Option.encode(m.correctAnswer, w.uint32(66).fork()).ldelim();
|
|
58096
|
+
if (m.endTime != null && Object.hasOwnProperty.call(m, "endTime"))
|
|
58097
|
+
w.uint32(72).int64(m.endTime);
|
|
58098
|
+
if (m.hideParticipantName != null && Object.hasOwnProperty.call(m, "hideParticipantName"))
|
|
58099
|
+
w.uint32(80).bool(m.hideParticipantName);
|
|
58100
|
+
if (m.allowAddOption != null && Object.hasOwnProperty.call(m, "allowAddOption"))
|
|
58101
|
+
w.uint32(88).bool(m.allowAddOption);
|
|
58052
58102
|
return w;
|
|
58053
58103
|
};
|
|
58054
58104
|
|
|
@@ -58095,6 +58145,18 @@ export const proto = $root.proto = (() => {
|
|
|
58095
58145
|
m.correctAnswer = $root.proto.Message.PollCreationMessage.Option.decode(r, r.uint32());
|
|
58096
58146
|
break;
|
|
58097
58147
|
}
|
|
58148
|
+
case 9: {
|
|
58149
|
+
m.endTime = r.int64();
|
|
58150
|
+
break;
|
|
58151
|
+
}
|
|
58152
|
+
case 10: {
|
|
58153
|
+
m.hideParticipantName = r.bool();
|
|
58154
|
+
break;
|
|
58155
|
+
}
|
|
58156
|
+
case 11: {
|
|
58157
|
+
m.allowAddOption = r.bool();
|
|
58158
|
+
break;
|
|
58159
|
+
}
|
|
58098
58160
|
default:
|
|
58099
58161
|
r.skipType(t & 7);
|
|
58100
58162
|
break;
|
|
@@ -58175,6 +58237,20 @@ export const proto = $root.proto = (() => {
|
|
|
58175
58237
|
throw TypeError(".proto.Message.PollCreationMessage.correctAnswer: object expected");
|
|
58176
58238
|
m.correctAnswer = $root.proto.Message.PollCreationMessage.Option.fromObject(d.correctAnswer);
|
|
58177
58239
|
}
|
|
58240
|
+
if (d.endTime != null) {
|
|
58241
|
+
if ($util.Long)
|
|
58242
|
+
(m.endTime = $util.Long.fromValue(d.endTime)).unsigned = false;
|
|
58243
|
+
else if (typeof d.endTime === "string")
|
|
58244
|
+
m.endTime = parseInt(d.endTime, 10);
|
|
58245
|
+
else if (typeof d.endTime === "number")
|
|
58246
|
+
m.endTime = d.endTime;
|
|
58247
|
+
else if (typeof d.endTime === "object")
|
|
58248
|
+
m.endTime = new $util.LongBits(d.endTime.low >>> 0, d.endTime.high >>> 0).toNumber();
|
|
58249
|
+
}
|
|
58250
|
+
if (d.hideParticipantName != null)
|
|
58251
|
+
m.hideParticipantName = Boolean(d.hideParticipantName);
|
|
58252
|
+
if (d.allowAddOption != null)
|
|
58253
|
+
m.allowAddOption = Boolean(d.allowAddOption);
|
|
58178
58254
|
return m;
|
|
58179
58255
|
};
|
|
58180
58256
|
|
|
@@ -58226,6 +58302,24 @@ export const proto = $root.proto = (() => {
|
|
|
58226
58302
|
if (o.oneofs)
|
|
58227
58303
|
d._correctAnswer = "correctAnswer";
|
|
58228
58304
|
}
|
|
58305
|
+
if (m.endTime != null && m.hasOwnProperty("endTime")) {
|
|
58306
|
+
if (typeof m.endTime === "number")
|
|
58307
|
+
d.endTime = o.longs === String ? String(m.endTime) : m.endTime;
|
|
58308
|
+
else
|
|
58309
|
+
d.endTime = o.longs === String ? longToString(m.endTime) : o.longs === Number ? longToNumber(m.endTime) : m.endTime;
|
|
58310
|
+
if (o.oneofs)
|
|
58311
|
+
d._endTime = "endTime";
|
|
58312
|
+
}
|
|
58313
|
+
if (m.hideParticipantName != null && m.hasOwnProperty("hideParticipantName")) {
|
|
58314
|
+
d.hideParticipantName = m.hideParticipantName;
|
|
58315
|
+
if (o.oneofs)
|
|
58316
|
+
d._hideParticipantName = "hideParticipantName";
|
|
58317
|
+
}
|
|
58318
|
+
if (m.allowAddOption != null && m.hasOwnProperty("allowAddOption")) {
|
|
58319
|
+
d.allowAddOption = m.allowAddOption;
|
|
58320
|
+
if (o.oneofs)
|
|
58321
|
+
d._allowAddOption = "allowAddOption";
|
|
58322
|
+
}
|
|
58229
58323
|
return d;
|
|
58230
58324
|
};
|
|
58231
58325
|
|
|
@@ -58936,6 +59030,119 @@ export const proto = $root.proto = (() => {
|
|
|
58936
59030
|
return PollUpdateMessage;
|
|
58937
59031
|
})();
|
|
58938
59032
|
|
|
59033
|
+
Message.PollAddOptionMessage = (function() {
|
|
59034
|
+
|
|
59035
|
+
function PollAddOptionMessage(p) {
|
|
59036
|
+
if (p)
|
|
59037
|
+
for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
|
|
59038
|
+
if (p[ks[i]] != null)
|
|
59039
|
+
this[ks[i]] = p[ks[i]];
|
|
59040
|
+
}
|
|
59041
|
+
|
|
59042
|
+
PollAddOptionMessage.prototype.pollCreationMessageKey = null;
|
|
59043
|
+
PollAddOptionMessage.prototype.addOption = null;
|
|
59044
|
+
|
|
59045
|
+
let $oneOfFields;
|
|
59046
|
+
|
|
59047
|
+
// Virtual OneOf for proto3 optional field
|
|
59048
|
+
Object.defineProperty(PollAddOptionMessage.prototype, "_pollCreationMessageKey", {
|
|
59049
|
+
get: $util.oneOfGetter($oneOfFields = ["pollCreationMessageKey"]),
|
|
59050
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
59051
|
+
});
|
|
59052
|
+
|
|
59053
|
+
// Virtual OneOf for proto3 optional field
|
|
59054
|
+
Object.defineProperty(PollAddOptionMessage.prototype, "_addOption", {
|
|
59055
|
+
get: $util.oneOfGetter($oneOfFields = ["addOption"]),
|
|
59056
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
59057
|
+
});
|
|
59058
|
+
|
|
59059
|
+
PollAddOptionMessage.create = function create(properties) {
|
|
59060
|
+
return new PollAddOptionMessage(properties);
|
|
59061
|
+
};
|
|
59062
|
+
|
|
59063
|
+
PollAddOptionMessage.encode = function encode(m, w) {
|
|
59064
|
+
if (!w)
|
|
59065
|
+
w = $Writer.create();
|
|
59066
|
+
if (m.pollCreationMessageKey != null && Object.hasOwnProperty.call(m, "pollCreationMessageKey"))
|
|
59067
|
+
$root.proto.MessageKey.encode(m.pollCreationMessageKey, w.uint32(10).fork()).ldelim();
|
|
59068
|
+
if (m.addOption != null && Object.hasOwnProperty.call(m, "addOption"))
|
|
59069
|
+
$root.proto.Message.PollCreationMessage.Option.encode(m.addOption, w.uint32(18).fork()).ldelim();
|
|
59070
|
+
return w;
|
|
59071
|
+
};
|
|
59072
|
+
|
|
59073
|
+
PollAddOptionMessage.decode = function decode(r, l, e) {
|
|
59074
|
+
if (!(r instanceof $Reader))
|
|
59075
|
+
r = $Reader.create(r);
|
|
59076
|
+
var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Message.PollAddOptionMessage();
|
|
59077
|
+
while (r.pos < c) {
|
|
59078
|
+
var t = r.uint32();
|
|
59079
|
+
if (t === e)
|
|
59080
|
+
break;
|
|
59081
|
+
switch (t >>> 3) {
|
|
59082
|
+
case 1: {
|
|
59083
|
+
m.pollCreationMessageKey = $root.proto.MessageKey.decode(r, r.uint32());
|
|
59084
|
+
break;
|
|
59085
|
+
}
|
|
59086
|
+
case 2: {
|
|
59087
|
+
m.addOption = $root.proto.Message.PollCreationMessage.Option.decode(r, r.uint32());
|
|
59088
|
+
break;
|
|
59089
|
+
}
|
|
59090
|
+
default:
|
|
59091
|
+
r.skipType(t & 7);
|
|
59092
|
+
break;
|
|
59093
|
+
}
|
|
59094
|
+
}
|
|
59095
|
+
return m;
|
|
59096
|
+
};
|
|
59097
|
+
|
|
59098
|
+
PollAddOptionMessage.fromObject = function fromObject(d) {
|
|
59099
|
+
if (d instanceof $root.proto.Message.PollAddOptionMessage)
|
|
59100
|
+
return d;
|
|
59101
|
+
var m = new $root.proto.Message.PollAddOptionMessage();
|
|
59102
|
+
if (d.pollCreationMessageKey != null) {
|
|
59103
|
+
if (typeof d.pollCreationMessageKey !== "object")
|
|
59104
|
+
throw TypeError(".proto.Message.PollAddOptionMessage.pollCreationMessageKey: object expected");
|
|
59105
|
+
m.pollCreationMessageKey = $root.proto.MessageKey.fromObject(d.pollCreationMessageKey);
|
|
59106
|
+
}
|
|
59107
|
+
if (d.addOption != null) {
|
|
59108
|
+
if (typeof d.addOption !== "object")
|
|
59109
|
+
throw TypeError(".proto.Message.PollAddOptionMessage.addOption: object expected");
|
|
59110
|
+
m.addOption = $root.proto.Message.PollCreationMessage.Option.fromObject(d.addOption);
|
|
59111
|
+
}
|
|
59112
|
+
return m;
|
|
59113
|
+
};
|
|
59114
|
+
|
|
59115
|
+
PollAddOptionMessage.toObject = function toObject(m, o) {
|
|
59116
|
+
if (!o)
|
|
59117
|
+
o = {};
|
|
59118
|
+
var d = {};
|
|
59119
|
+
if (m.pollCreationMessageKey != null && m.hasOwnProperty("pollCreationMessageKey")) {
|
|
59120
|
+
d.pollCreationMessageKey = $root.proto.MessageKey.toObject(m.pollCreationMessageKey, o);
|
|
59121
|
+
if (o.oneofs)
|
|
59122
|
+
d._pollCreationMessageKey = "pollCreationMessageKey";
|
|
59123
|
+
}
|
|
59124
|
+
if (m.addOption != null && m.hasOwnProperty("addOption")) {
|
|
59125
|
+
d.addOption = $root.proto.Message.PollCreationMessage.Option.toObject(m.addOption, o);
|
|
59126
|
+
if (o.oneofs)
|
|
59127
|
+
d._addOption = "addOption";
|
|
59128
|
+
}
|
|
59129
|
+
return d;
|
|
59130
|
+
};
|
|
59131
|
+
|
|
59132
|
+
PollAddOptionMessage.prototype.toJSON = function toJSON() {
|
|
59133
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
59134
|
+
};
|
|
59135
|
+
|
|
59136
|
+
PollAddOptionMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
59137
|
+
if (typeUrlPrefix === undefined) {
|
|
59138
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
59139
|
+
}
|
|
59140
|
+
return typeUrlPrefix + "/proto.Message.PollAddOptionMessage";
|
|
59141
|
+
};
|
|
59142
|
+
|
|
59143
|
+
return PollAddOptionMessage;
|
|
59144
|
+
})();
|
|
59145
|
+
|
|
58939
59146
|
Message.PollUpdateMessageMetadata = (function() {
|
|
58940
59147
|
|
|
58941
59148
|
function PollUpdateMessageMetadata(p) {
|
package/lib/Defaults/index.d.ts
CHANGED
|
@@ -38,6 +38,9 @@ export declare const DEFAULT_CONNECTION_CONFIG: SocketConfig;
|
|
|
38
38
|
export declare const MEDIA_PATH_MAP: {
|
|
39
39
|
[T in MediaType]?: string;
|
|
40
40
|
};
|
|
41
|
+
export declare const NEWSLETTER_MEDIA_PATH_MAP: {
|
|
42
|
+
[T in MediaType]?: string;
|
|
43
|
+
};
|
|
41
44
|
export declare const MEDIA_HKDF_KEY_MAPPING: {
|
|
42
45
|
audio: string;
|
|
43
46
|
document: string;
|
|
@@ -1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A;AAChE,eAAO,MAAM,YAAY,IAAI,CAAA;AAC7B,eAAO,MAAM,eAAe,qBAAmB,CAAA;AAC/C,eAAO,MAAM,eAAe,qBAAyC,CAAA;AACrE,yGAAyG;AACzG,eAAO,MAAM,SAAS,QAAwF,CAAA;AAE9G,eAAO,MAAM,eAAe;;;;CAI3B,CAAA;AAED,eAAO,MAAM,yBAAyB,qCAQrC,CAAA;AAED,eAAO,MAAM,kBAAkB;;;;;CAK9B,CAAA;AAED,eAAO,MAAM,yBAAyB,EAAE,YAmCvC,CAAA;AAED,eAAO,MAAM,cAAc,EAAE;KAAG,CAAC,IAAI,SAAS,CAAC,CAAC,EAAE,MAAM;CAavD,CAAA;AAED,eAAO,MAAM,yBAAyB,EAAE;KAAG,CAAC,IAAI,SAAS,CAAC,CAAC,EAAE,MAAM;CAUlE,CAAA;AAED,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;CAsBlC,CAAA;AAED,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,sBAAsB,CAAA;AAE3D,eAAO,MAAM,UAAU,EAAkC,SAAS,EAAE,CAAA;AAEpE,yHAAyH;AACzH,eAAO,MAAM,8BAA8B,SAAU,CAAA;AAErD,eAAO,MAAM,gBAAgB,IAAI,CAAA;AAEjC,eAAO,MAAM,oBAAoB,MAAM,CAAA;AAEvC,eAAO,MAAM,cAAc,QAAQ,CAAA;AAEnC,eAAO,MAAM,MAAM;;;;;CAKlB,CAAA"}
|
package/lib/Defaults/index.js
CHANGED
|
@@ -95,6 +95,17 @@ export const MEDIA_PATH_MAP = {
|
|
|
95
95
|
'md-msg-hist': '/mms/md-app-state',
|
|
96
96
|
'biz-cover-photo': '/pps/biz-cover-photo'
|
|
97
97
|
};
|
|
98
|
+
export const NEWSLETTER_MEDIA_PATH_MAP = {
|
|
99
|
+
image: '/newsletter/newsletter-image',
|
|
100
|
+
video: '/newsletter/newsletter-video',
|
|
101
|
+
document: '/newsletter/newsletter-document',
|
|
102
|
+
audio: '/newsletter/newsletter-audio',
|
|
103
|
+
gif: '/newsletter/newsletter-gif',
|
|
104
|
+
ptt: '/newsletter/newsletter-ptt',
|
|
105
|
+
ptv: '/newsletter/newsletter-ptv',
|
|
106
|
+
sticker: '/newsletter/newsletter-sticker-pack',
|
|
107
|
+
'thumbnail-link': '/newsletter/newsletter-image'
|
|
108
|
+
};
|
|
98
109
|
export const MEDIA_HKDF_KEY_MAPPING = {
|
|
99
110
|
audio: 'Audio',
|
|
100
111
|
document: 'Document',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Defaults/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAE7D,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACjD,OAAO,MAAM,MAAM,iBAAiB,CAAA;AAEpC,MAAM,OAAO,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,CAAC,CAAA;AAErC,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;AAEjD,MAAM,CAAC,MAAM,cAAc,GAAG,0BAA0B,CAAA;AACxD,MAAM,CAAC,MAAM,iBAAiB,GAAG,kCAAkC,CAAA;AACnE,MAAM,CAAC,MAAM,iBAAiB,GAAG,kCAAkC,CAAA;AACnE,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,CAAA;AACxC,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAA;AACpC,MAAM,CAAC,MAAM,mBAAmB,GAAG,SAAS,CAAA;AAE5C,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AAC5D,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,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AAG,KAAK,CAAA,CAAC,aAAa;AAEjD,MAAM,CAAC,MAAM,MAAM,GAAG;IACrB,MAAM,EAAE,EAAE,GAAG,IAAI;IACjB,IAAI,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI;IACpB,GAAG,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IACxB,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;CAC7B,CAAA"}
|
package/lib/Socket/business.d.ts
CHANGED
|
@@ -33,6 +33,18 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
|
|
|
33
33
|
assertSessions: (jids: string[], force?: boolean) => Promise<boolean>;
|
|
34
34
|
relayMessage: (jid: string, message: import("../index.js").proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: import("../index.js").MessageRelayOptions) => Promise<string>;
|
|
35
35
|
sendChannelStatus: (jid: string, content: import("../index.js").AnyMessageContent, options?: import("./channelStatus.js").ChannelStatusOptions) => Promise<import("./channelStatus.js").ChannelStatusSent>;
|
|
36
|
+
newsletterReactStatus: (jid: string, serverId: string, reaction: string | null) => Promise<void>;
|
|
37
|
+
newsletterRevokeStatus: (jid: string, statusId: string) => Promise<BinaryNode>;
|
|
38
|
+
newsletterFetchStatus: (jid: string, options: import("./channelStatus.js").ChannelStatusFetchOptions) => Promise<import("./channelStatus.js").ChannelStatusFetchResult>;
|
|
39
|
+
newsletterFetchStatusResponses: (jid: string, serverId: string, options: import("./channelStatus.js").ChannelStatusResponsesOptions) => Promise<import("./channelStatus.js").ChannelStatusResponsesResult>;
|
|
40
|
+
newsletterSendStatusViewReceipt: (jid: string, receiptStanzaId: string, sortId: number) => Promise<void>;
|
|
41
|
+
newsletterScheduleChannelPost: (jid: string, content: import("../index.js").AnyMessageContent, publishAtMs: number, options?: import("./channelSchedule.js").ChannelScheduleOptions) => Promise<import("./channelSchedule.js").ChannelScheduledPost>;
|
|
42
|
+
newsletterRescheduleChannelPost: (jid: string, clientId: string, content: import("../index.js").AnyMessageContent, publishAtMs: number, options?: import("./channelSchedule.js").ChannelScheduleOptions) => Promise<import("./channelSchedule.js").ChannelScheduledPost>;
|
|
43
|
+
newsletterSendChannelPostNow: (jid: string, clientId: string, content: import("../index.js").AnyMessageContent, options?: import("./channelSchedule.js").ChannelScheduleOptions) => Promise<import("./channelSchedule.js").ChannelScheduledPost>;
|
|
44
|
+
newsletterCancelChannelPost: (jid: string, clientId: string) => Promise<BinaryNode>;
|
|
45
|
+
newsletterFetchChannelScheduledPosts: (jid: string, options: import("./channelSchedule.js").ChannelScheduleFetchOptions) => Promise<import("./channelSchedule.js").ChannelScheduleFetchResult>;
|
|
46
|
+
newsletterDirectorySearch: (searchText: string, options?: import("./newsletterDirectory.js").NewsletterDirectorySearchOptions) => Promise<import("./newsletterDirectory.js").NewsletterDirectoryResult>;
|
|
47
|
+
newsletterDirectoryList: (options?: import("./newsletterDirectory.js").NewsletterDirectoryListOptions) => Promise<import("./newsletterDirectory.js").NewsletterDirectoryResult>;
|
|
36
48
|
sendGroupStatus: (jid: string, content: import("../index.js").AnyMessageContent, options?: {}) => Promise<import("../index.js").WAMessage>;
|
|
37
49
|
sendStickerPack: (jid: string, pack: import("../index.js").StickerPack) => Promise<import("../index.js").StickerPackResult>;
|
|
38
50
|
checkUsername: (username: string, includeSuggestions?: boolean, sessionId?: string) => Promise<import("../index.js").UsernameCheckResult>;
|
|
@@ -89,6 +101,17 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
|
|
|
89
101
|
})[]>;
|
|
90
102
|
updateMemberLabel: (jid: string, memberLabel: string) => Promise<string>;
|
|
91
103
|
updateMediaMessage: (message: import("../index.js").WAMessage) => Promise<import("../index.js").WAMessage>;
|
|
104
|
+
sendStickerReaction(jid: string, target: import("../index.js").WAMessage, sticker: WAMediaUpload, options?: import("../index.js").MiscMessageGenerationOptions): Promise<import("../index.js").WAMessage | undefined>;
|
|
105
|
+
sendPersonalStatus(content: import("../index.js").AnyMessageContent, options?: import("../index.js").MiscMessageGenerationOptions): Promise<import("../index.js").WAMessage | undefined>;
|
|
106
|
+
pinMessage(jid: string, key: import("../index.js").WAMessageKey, duration?: 86400 | 604800 | 2592000): Promise<import("../index.js").WAMessage | undefined>;
|
|
107
|
+
unpinMessage(jid: string, key: import("../index.js").WAMessageKey): Promise<import("../index.js").WAMessage | undefined>;
|
|
108
|
+
sendPollVote(jid: string, pollCreationMessageKey: import("../index.js").WAMessageKey, options: string | string[], pollInfo: {
|
|
109
|
+
messageSecret: Uint8Array;
|
|
110
|
+
creatorJid?: string;
|
|
111
|
+
}): Promise<import("../index.js").WAMessage | undefined>;
|
|
112
|
+
newsletterSendPollVote: (jid: string, parentServerId: string | number, options: string | string[]) => Promise<{
|
|
113
|
+
id: string;
|
|
114
|
+
}>;
|
|
92
115
|
sendMessage: (jid: string, content: import("../index.js").AnyMessageContent, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
93
116
|
newsletterCreate: (name: string, description?: string) => Promise<import("../index.js").NewsletterMetadata>;
|
|
94
117
|
newsletterUpdate: (jid: string, updates: import("../index.js").NewsletterUpdate) => Promise<unknown>;
|
|
@@ -193,6 +216,7 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
|
|
|
193
216
|
getBusinessProfile: (jid: string) => Promise<import("../index.js").WABusinessProfile | void>;
|
|
194
217
|
resyncAppState: (collections: readonly ("critical_unblock_low" | "regular_high" | "regular_low" | "critical_block" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
|
195
218
|
chatModify: (mod: import("../index.js").ChatModification, jid: string) => Promise<void>;
|
|
219
|
+
pinChat: (jid: string, pin?: boolean) => Promise<void>;
|
|
196
220
|
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
|
|
197
221
|
addOrEditContact: (jid: string, contact: import("../index.js").proto.SyncActionValue.IContactAction) => Promise<void>;
|
|
198
222
|
removeContact: (jid: string) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"business.d.ts","sourceRoot":"","sources":["../../src/Socket/business.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAC5G,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAA;AAUnE,OAAO,EAAE,KAAK,UAAU,EAAqC,MAAM,aAAa,CAAA;AAIhF,eAAO,MAAM,kBAAkB,GAAI,QAAQ,YAAY;;+BA8Od,MAAM,eAAe,MAAM;yCAjGjB,iBAAiB;;;;2BAmD/B,MAAM;;;4BAkIL,aAAa;gCAwCT,MAAM,EAAE;;;+BA9ET,MAAM,UAAU,aAAa;kCAxR1B,0BAA0B;8BA2E9B,aAAa;2BAoChB,MAAM
|
|
1
|
+
{"version":3,"file":"business.d.ts","sourceRoot":"","sources":["../../src/Socket/business.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAC5G,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAA;AAUnE,OAAO,EAAE,KAAK,UAAU,EAAqC,MAAM,aAAa,CAAA;AAIhF,eAAO,MAAM,kBAAkB,GAAI,QAAQ,YAAY;;+BA8Od,MAAM,eAAe,MAAM;yCAjGjB,iBAAiB;;;;2BAmD/B,MAAM;;;4BAkIL,aAAa;gCAwCT,MAAM,EAAE;;;+BA9ET,MAAM,UAAU,aAAa;kCAxR1B,0BAA0B;8BA2E9B,aAAa;2BAoChB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAsS67rC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAAj9jB,CAAC;;;;;;;;;0DAhXtgoB,GAAG,0BAChB,GAAH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8WF,CAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type BinaryNode } from '../WABinary/index.js';
|
|
2
|
+
/** Deps for the channel poll vote call — same shape as `ChannelStatusQueryDeps`. */
|
|
3
|
+
export type NewsletterPollVoteDeps = {
|
|
4
|
+
query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>;
|
|
5
|
+
generateMessageTag: () => string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Vote on a channel (newsletter) poll, by option name.
|
|
9
|
+
*
|
|
10
|
+
* Wire shape — a plain `<message>` stanza, NOT an encrypted
|
|
11
|
+
* pollUpdateMessage like a group vote:
|
|
12
|
+
*
|
|
13
|
+
* ```xml
|
|
14
|
+
* <message to="<channel JID>" id="<tag>" type="poll" server_id="<parent poll server id>">
|
|
15
|
+
* <meta polltype="vote" />
|
|
16
|
+
* <votes>
|
|
17
|
+
* <vote>SHA-256(option name)</vote>
|
|
18
|
+
* ...
|
|
19
|
+
* </votes>
|
|
20
|
+
* </message>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* The vote is UNENCRYPTED: each `<vote>` node carries the raw SHA-256
|
|
24
|
+
* hash of the option name (see `buildNewsletterPollVotes`). Evidence:
|
|
25
|
+
* @hanzofc/baileys `newsletterSendPollVote` builds exactly this stanza,
|
|
26
|
+
* and the decompiled WhatsApp APK agrees — `C0936Imf` sets
|
|
27
|
+
* `polltype="vote"` on the poll meta node, `C5390Kez`
|
|
28
|
+
* (IncomingPollMessageHandler) routes on type `poll` + polltype `vote`,
|
|
29
|
+
* and `C5497Kgl` parses an incoming newsletter `<message>`'s
|
|
30
|
+
* `<votes><vote>` children as raw bytes.
|
|
31
|
+
*
|
|
32
|
+
* `parentServerId` is the server id of the poll creation message in the
|
|
33
|
+
* channel — the same id `newsletterReactMessage` takes for a channel
|
|
34
|
+
* message. No message secret is needed (there is nothing to encrypt),
|
|
35
|
+
* so unlike `sendPollVote` this takes no `pollInfo`.
|
|
36
|
+
* @param jid channel (newsletter) JID the poll was posted in
|
|
37
|
+
* @param parentServerId server id of the poll creation message in the channel
|
|
38
|
+
* @param options voted option name(s)
|
|
39
|
+
* @returns the id of the vote stanza that went out
|
|
40
|
+
*/
|
|
41
|
+
export declare const newsletterSendPollVote: (jid: string, parentServerId: string | number, options: string | string[], deps: NewsletterPollVoteDeps) => Promise<{
|
|
42
|
+
id: string;
|
|
43
|
+
}>;
|
|
44
|
+
//# sourceMappingURL=channelPollVote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channelPollVote.d.ts","sourceRoot":"","sources":["../../src/Socket/channelPollVote.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEtD,oFAAoF;AACpF,MAAM,MAAM,sBAAsB,GAAG;IACpC,KAAK,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAA;IACpE,kBAAkB,EAAE,MAAM,MAAM,CAAA;CAChC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,sBAAsB,GAClC,KAAK,MAAM,EACX,gBAAgB,MAAM,GAAG,MAAM,EAC/B,SAAS,MAAM,GAAG,MAAM,EAAE,EAC1B,MAAM,sBAAsB,KAC1B,OAAO,CAAC;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CA8BxB,CAAA"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Boom } from '@hapi/boom';
|
|
2
|
+
import { buildNewsletterPollVotes } from '../Utils/process-message.js';
|
|
3
|
+
import {} from '../WABinary/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* Vote on a channel (newsletter) poll, by option name.
|
|
6
|
+
*
|
|
7
|
+
* Wire shape — a plain `<message>` stanza, NOT an encrypted
|
|
8
|
+
* pollUpdateMessage like a group vote:
|
|
9
|
+
*
|
|
10
|
+
* ```xml
|
|
11
|
+
* <message to="<channel JID>" id="<tag>" type="poll" server_id="<parent poll server id>">
|
|
12
|
+
* <meta polltype="vote" />
|
|
13
|
+
* <votes>
|
|
14
|
+
* <vote>SHA-256(option name)</vote>
|
|
15
|
+
* ...
|
|
16
|
+
* </votes>
|
|
17
|
+
* </message>
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* The vote is UNENCRYPTED: each `<vote>` node carries the raw SHA-256
|
|
21
|
+
* hash of the option name (see `buildNewsletterPollVotes`). Evidence:
|
|
22
|
+
* @hanzofc/baileys `newsletterSendPollVote` builds exactly this stanza,
|
|
23
|
+
* and the decompiled WhatsApp APK agrees — `C0936Imf` sets
|
|
24
|
+
* `polltype="vote"` on the poll meta node, `C5390Kez`
|
|
25
|
+
* (IncomingPollMessageHandler) routes on type `poll` + polltype `vote`,
|
|
26
|
+
* and `C5497Kgl` parses an incoming newsletter `<message>`'s
|
|
27
|
+
* `<votes><vote>` children as raw bytes.
|
|
28
|
+
*
|
|
29
|
+
* `parentServerId` is the server id of the poll creation message in the
|
|
30
|
+
* channel — the same id `newsletterReactMessage` takes for a channel
|
|
31
|
+
* message. No message secret is needed (there is nothing to encrypt),
|
|
32
|
+
* so unlike `sendPollVote` this takes no `pollInfo`.
|
|
33
|
+
* @param jid channel (newsletter) JID the poll was posted in
|
|
34
|
+
* @param parentServerId server id of the poll creation message in the channel
|
|
35
|
+
* @param options voted option name(s)
|
|
36
|
+
* @returns the id of the vote stanza that went out
|
|
37
|
+
*/
|
|
38
|
+
export const newsletterSendPollVote = async (jid, parentServerId, options, deps) => {
|
|
39
|
+
const optionNames = Array.isArray(options) ? options : [options];
|
|
40
|
+
if (!optionNames.length) {
|
|
41
|
+
throw new Boom('newsletterSendPollVote needs at least one option', { statusCode: 400 });
|
|
42
|
+
}
|
|
43
|
+
if (optionNames.some(name => typeof name !== 'string' || !name.length)) {
|
|
44
|
+
throw new Boom('newsletterSendPollVote needs non-empty option names', { statusCode: 400 });
|
|
45
|
+
}
|
|
46
|
+
if (parentServerId === undefined || parentServerId === null || String(parentServerId).length === 0) {
|
|
47
|
+
throw new Boom('newsletterSendPollVote needs a parentServerId', { statusCode: 400 });
|
|
48
|
+
}
|
|
49
|
+
const messageId = deps.generateMessageTag();
|
|
50
|
+
await deps.query({
|
|
51
|
+
tag: 'message',
|
|
52
|
+
attrs: {
|
|
53
|
+
to: jid,
|
|
54
|
+
id: messageId,
|
|
55
|
+
type: 'poll',
|
|
56
|
+
server_id: String(parentServerId)
|
|
57
|
+
},
|
|
58
|
+
content: [
|
|
59
|
+
{ tag: 'meta', attrs: { polltype: 'vote' } },
|
|
60
|
+
{ tag: 'votes', attrs: {}, content: buildNewsletterPollVotes(optionNames) }
|
|
61
|
+
]
|
|
62
|
+
});
|
|
63
|
+
return { id: messageId };
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=channelPollVote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channelPollVote.js","sourceRoot":"","sources":["../../src/Socket/channelPollVote.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AACtE,OAAO,EAAmB,MAAM,sBAAsB,CAAA;AAQtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,EAC1C,GAAW,EACX,cAA+B,EAC/B,OAA0B,EAC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