@vreden/meta
Version:
Baileys is a lightweight JavaScript library for interacting with the WhatsApp Web API using WebSocket.
978 lines (921 loc) • 5.2 MB
JavaScript
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
"use strict";
var $protobuf = require("protobufjs/minimal");
// Common aliases
var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
// Exported root namespace
var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
$root.MdStorageMsgRowOpaqueData = (function() {
/**
* Namespace MdStorageMsgRowOpaqueData.
* @exports MdStorageMsgRowOpaqueData
* @namespace
*/
var MdStorageMsgRowOpaqueData = {};
MdStorageMsgRowOpaqueData.MsgOpaqueData = (function() {
/**
* Properties of a MsgOpaqueData.
* @memberof MdStorageMsgRowOpaqueData
* @interface IMsgOpaqueData
* @property {string|null} [body] MsgOpaqueData body
* @property {string|null} [caption] MsgOpaqueData caption
* @property {number|null} [lng] MsgOpaqueData lng
* @property {boolean|null} [isLive] MsgOpaqueData isLive
* @property {number|null} [lat] MsgOpaqueData lat
* @property {number|null} [paymentAmount1000] MsgOpaqueData paymentAmount1000
* @property {string|null} [paymentNoteMsgBody] MsgOpaqueData paymentNoteMsgBody
* @property {string|null} [matchedText] MsgOpaqueData matchedText
* @property {string|null} [title] MsgOpaqueData title
* @property {string|null} [description] MsgOpaqueData description
* @property {Uint8Array|null} [futureproofBuffer] MsgOpaqueData futureproofBuffer
* @property {string|null} [clientUrl] MsgOpaqueData clientUrl
* @property {string|null} [loc] MsgOpaqueData loc
* @property {string|null} [pollName] MsgOpaqueData pollName
* @property {Array.<MdStorageMsgRowOpaqueData.MsgOpaqueData.IPollOption>|null} [pollOptions] MsgOpaqueData pollOptions
* @property {number|null} [pollSelectableOptionsCount] MsgOpaqueData pollSelectableOptionsCount
* @property {Uint8Array|null} [messageSecret] MsgOpaqueData messageSecret
* @property {string|null} [originalSelfAuthor] MsgOpaqueData originalSelfAuthor
* @property {number|Long|null} [senderTimestampMs] MsgOpaqueData senderTimestampMs
* @property {string|null} [pollUpdateParentKey] MsgOpaqueData pollUpdateParentKey
* @property {E2E.Message.IPollEncValue|null} [encPollVote] MsgOpaqueData encPollVote
* @property {boolean|null} [isSentCagPollCreation] MsgOpaqueData isSentCagPollCreation
* @property {MdStorageMsgRowOpaqueData.MsgOpaqueData.PollContentType|null} [pollContentType] MsgOpaqueData pollContentType
* @property {MdStorageMsgRowOpaqueData.MsgOpaqueData.IPollVotesSnapshot|null} [pollVotesSnapshot] MsgOpaqueData pollVotesSnapshot
* @property {string|null} [encReactionTargetMessageKey] MsgOpaqueData encReactionTargetMessageKey
* @property {Uint8Array|null} [encReactionEncPayload] MsgOpaqueData encReactionEncPayload
* @property {Uint8Array|null} [encReactionEncIv] MsgOpaqueData encReactionEncIv
* @property {Uint8Array|null} [botMessageSecret] MsgOpaqueData botMessageSecret
* @property {string|null} [targetMessageKey] MsgOpaqueData targetMessageKey
* @property {Uint8Array|null} [encPayload] MsgOpaqueData encPayload
* @property {Uint8Array|null} [encIv] MsgOpaqueData encIv
* @property {string|null} [eventName] MsgOpaqueData eventName
* @property {boolean|null} [isEventCanceled] MsgOpaqueData isEventCanceled
* @property {string|null} [eventDescription] MsgOpaqueData eventDescription
* @property {string|null} [eventJoinLink] MsgOpaqueData eventJoinLink
* @property {number|Long|null} [eventStartTime] MsgOpaqueData eventStartTime
* @property {MdStorageMsgRowOpaqueData.MsgOpaqueData.IEventLocation|null} [eventLocation] MsgOpaqueData eventLocation
* @property {number|Long|null} [eventEndTime] MsgOpaqueData eventEndTime
* @property {boolean|null} [eventIsScheduledCall] MsgOpaqueData eventIsScheduledCall
* @property {boolean|null} [eventExtraGuestsAllowed] MsgOpaqueData eventExtraGuestsAllowed
* @property {Uint8Array|null} [plainProtobufBytes] MsgOpaqueData plainProtobufBytes
*/
/**
* Constructs a new MsgOpaqueData.
* @memberof MdStorageMsgRowOpaqueData
* @classdesc Represents a MsgOpaqueData.
* @implements IMsgOpaqueData
* @constructor
* @param {MdStorageMsgRowOpaqueData.IMsgOpaqueData=} [properties] Properties to set
*/
function MsgOpaqueData(properties) {
this.pollOptions = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* MsgOpaqueData body.
* @member {string} body
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.body = "";
/**
* MsgOpaqueData caption.
* @member {string} caption
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.caption = "";
/**
* MsgOpaqueData lng.
* @member {number} lng
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.lng = 0;
/**
* MsgOpaqueData isLive.
* @member {boolean} isLive
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.isLive = false;
/**
* MsgOpaqueData lat.
* @member {number} lat
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.lat = 0;
/**
* MsgOpaqueData paymentAmount1000.
* @member {number} paymentAmount1000
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.paymentAmount1000 = 0;
/**
* MsgOpaqueData paymentNoteMsgBody.
* @member {string} paymentNoteMsgBody
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.paymentNoteMsgBody = "";
/**
* MsgOpaqueData matchedText.
* @member {string} matchedText
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.matchedText = "";
/**
* MsgOpaqueData title.
* @member {string} title
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.title = "";
/**
* MsgOpaqueData description.
* @member {string} description
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.description = "";
/**
* MsgOpaqueData futureproofBuffer.
* @member {Uint8Array} futureproofBuffer
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.futureproofBuffer = $util.newBuffer([]);
/**
* MsgOpaqueData clientUrl.
* @member {string} clientUrl
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.clientUrl = "";
/**
* MsgOpaqueData loc.
* @member {string} loc
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.loc = "";
/**
* MsgOpaqueData pollName.
* @member {string} pollName
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.pollName = "";
/**
* MsgOpaqueData pollOptions.
* @member {Array.<MdStorageMsgRowOpaqueData.MsgOpaqueData.IPollOption>} pollOptions
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.pollOptions = $util.emptyArray;
/**
* MsgOpaqueData pollSelectableOptionsCount.
* @member {number} pollSelectableOptionsCount
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.pollSelectableOptionsCount = 0;
/**
* MsgOpaqueData messageSecret.
* @member {Uint8Array} messageSecret
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.messageSecret = $util.newBuffer([]);
/**
* MsgOpaqueData originalSelfAuthor.
* @member {string} originalSelfAuthor
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.originalSelfAuthor = "";
/**
* MsgOpaqueData senderTimestampMs.
* @member {number|Long} senderTimestampMs
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.senderTimestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* MsgOpaqueData pollUpdateParentKey.
* @member {string} pollUpdateParentKey
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.pollUpdateParentKey = "";
/**
* MsgOpaqueData encPollVote.
* @member {E2E.Message.IPollEncValue|null|undefined} encPollVote
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.encPollVote = null;
/**
* MsgOpaqueData isSentCagPollCreation.
* @member {boolean} isSentCagPollCreation
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.isSentCagPollCreation = false;
/**
* MsgOpaqueData pollContentType.
* @member {MdStorageMsgRowOpaqueData.MsgOpaqueData.PollContentType} pollContentType
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.pollContentType = 0;
/**
* MsgOpaqueData pollVotesSnapshot.
* @member {MdStorageMsgRowOpaqueData.MsgOpaqueData.IPollVotesSnapshot|null|undefined} pollVotesSnapshot
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.pollVotesSnapshot = null;
/**
* MsgOpaqueData encReactionTargetMessageKey.
* @member {string} encReactionTargetMessageKey
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.encReactionTargetMessageKey = "";
/**
* MsgOpaqueData encReactionEncPayload.
* @member {Uint8Array} encReactionEncPayload
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.encReactionEncPayload = $util.newBuffer([]);
/**
* MsgOpaqueData encReactionEncIv.
* @member {Uint8Array} encReactionEncIv
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.encReactionEncIv = $util.newBuffer([]);
/**
* MsgOpaqueData botMessageSecret.
* @member {Uint8Array} botMessageSecret
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.botMessageSecret = $util.newBuffer([]);
/**
* MsgOpaqueData targetMessageKey.
* @member {string} targetMessageKey
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.targetMessageKey = "";
/**
* MsgOpaqueData encPayload.
* @member {Uint8Array} encPayload
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.encPayload = $util.newBuffer([]);
/**
* MsgOpaqueData encIv.
* @member {Uint8Array} encIv
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.encIv = $util.newBuffer([]);
/**
* MsgOpaqueData eventName.
* @member {string} eventName
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.eventName = "";
/**
* MsgOpaqueData isEventCanceled.
* @member {boolean} isEventCanceled
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.isEventCanceled = false;
/**
* MsgOpaqueData eventDescription.
* @member {string} eventDescription
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.eventDescription = "";
/**
* MsgOpaqueData eventJoinLink.
* @member {string} eventJoinLink
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.eventJoinLink = "";
/**
* MsgOpaqueData eventStartTime.
* @member {number|Long} eventStartTime
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.eventStartTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* MsgOpaqueData eventLocation.
* @member {MdStorageMsgRowOpaqueData.MsgOpaqueData.IEventLocation|null|undefined} eventLocation
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.eventLocation = null;
/**
* MsgOpaqueData eventEndTime.
* @member {number|Long} eventEndTime
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.eventEndTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* MsgOpaqueData eventIsScheduledCall.
* @member {boolean} eventIsScheduledCall
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.eventIsScheduledCall = false;
/**
* MsgOpaqueData eventExtraGuestsAllowed.
* @member {boolean} eventExtraGuestsAllowed
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.eventExtraGuestsAllowed = false;
/**
* MsgOpaqueData plainProtobufBytes.
* @member {Uint8Array} plainProtobufBytes
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @instance
*/
MsgOpaqueData.prototype.plainProtobufBytes = $util.newBuffer([]);
/**
* Creates a new MsgOpaqueData instance using the specified properties.
* @function create
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @static
* @param {MdStorageMsgRowOpaqueData.IMsgOpaqueData=} [properties] Properties to set
* @returns {MdStorageMsgRowOpaqueData.MsgOpaqueData} MsgOpaqueData instance
*/
MsgOpaqueData.create = function create(properties) {
return new MsgOpaqueData(properties);
};
/**
* Encodes the specified MsgOpaqueData message. Does not implicitly {@link MdStorageMsgRowOpaqueData.MsgOpaqueData.verify|verify} messages.
* @function encode
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @static
* @param {MdStorageMsgRowOpaqueData.IMsgOpaqueData} message MsgOpaqueData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
MsgOpaqueData.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.body != null && Object.hasOwnProperty.call(message, "body"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.body);
if (message.caption != null && Object.hasOwnProperty.call(message, "caption"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.caption);
if (message.lng != null && Object.hasOwnProperty.call(message, "lng"))
writer.uint32(/* id 5, wireType 1 =*/41).double(message.lng);
if (message.isLive != null && Object.hasOwnProperty.call(message, "isLive"))
writer.uint32(/* id 6, wireType 0 =*/48).bool(message.isLive);
if (message.lat != null && Object.hasOwnProperty.call(message, "lat"))
writer.uint32(/* id 7, wireType 1 =*/57).double(message.lat);
if (message.paymentAmount1000 != null && Object.hasOwnProperty.call(message, "paymentAmount1000"))
writer.uint32(/* id 8, wireType 0 =*/64).int32(message.paymentAmount1000);
if (message.paymentNoteMsgBody != null && Object.hasOwnProperty.call(message, "paymentNoteMsgBody"))
writer.uint32(/* id 9, wireType 2 =*/74).string(message.paymentNoteMsgBody);
if (message.matchedText != null && Object.hasOwnProperty.call(message, "matchedText"))
writer.uint32(/* id 11, wireType 2 =*/90).string(message.matchedText);
if (message.title != null && Object.hasOwnProperty.call(message, "title"))
writer.uint32(/* id 12, wireType 2 =*/98).string(message.title);
if (message.description != null && Object.hasOwnProperty.call(message, "description"))
writer.uint32(/* id 13, wireType 2 =*/106).string(message.description);
if (message.futureproofBuffer != null && Object.hasOwnProperty.call(message, "futureproofBuffer"))
writer.uint32(/* id 14, wireType 2 =*/114).bytes(message.futureproofBuffer);
if (message.clientUrl != null && Object.hasOwnProperty.call(message, "clientUrl"))
writer.uint32(/* id 15, wireType 2 =*/122).string(message.clientUrl);
if (message.loc != null && Object.hasOwnProperty.call(message, "loc"))
writer.uint32(/* id 16, wireType 2 =*/130).string(message.loc);
if (message.pollName != null && Object.hasOwnProperty.call(message, "pollName"))
writer.uint32(/* id 17, wireType 2 =*/138).string(message.pollName);
if (message.pollOptions != null && message.pollOptions.length)
for (var i = 0; i < message.pollOptions.length; ++i)
$root.MdStorageMsgRowOpaqueData.MsgOpaqueData.PollOption.encode(message.pollOptions[i], writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim();
if (message.pollSelectableOptionsCount != null && Object.hasOwnProperty.call(message, "pollSelectableOptionsCount"))
writer.uint32(/* id 20, wireType 0 =*/160).uint32(message.pollSelectableOptionsCount);
if (message.messageSecret != null && Object.hasOwnProperty.call(message, "messageSecret"))
writer.uint32(/* id 21, wireType 2 =*/170).bytes(message.messageSecret);
if (message.senderTimestampMs != null && Object.hasOwnProperty.call(message, "senderTimestampMs"))
writer.uint32(/* id 22, wireType 0 =*/176).int64(message.senderTimestampMs);
if (message.pollUpdateParentKey != null && Object.hasOwnProperty.call(message, "pollUpdateParentKey"))
writer.uint32(/* id 23, wireType 2 =*/186).string(message.pollUpdateParentKey);
if (message.encPollVote != null && Object.hasOwnProperty.call(message, "encPollVote"))
$root.E2E.Message.PollEncValue.encode(message.encPollVote, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim();
if (message.encReactionTargetMessageKey != null && Object.hasOwnProperty.call(message, "encReactionTargetMessageKey"))
writer.uint32(/* id 25, wireType 2 =*/202).string(message.encReactionTargetMessageKey);
if (message.encReactionEncPayload != null && Object.hasOwnProperty.call(message, "encReactionEncPayload"))
writer.uint32(/* id 26, wireType 2 =*/210).bytes(message.encReactionEncPayload);
if (message.encReactionEncIv != null && Object.hasOwnProperty.call(message, "encReactionEncIv"))
writer.uint32(/* id 27, wireType 2 =*/218).bytes(message.encReactionEncIv);
if (message.isSentCagPollCreation != null && Object.hasOwnProperty.call(message, "isSentCagPollCreation"))
writer.uint32(/* id 28, wireType 0 =*/224).bool(message.isSentCagPollCreation);
if (message.botMessageSecret != null && Object.hasOwnProperty.call(message, "botMessageSecret"))
writer.uint32(/* id 29, wireType 2 =*/234).bytes(message.botMessageSecret);
if (message.targetMessageKey != null && Object.hasOwnProperty.call(message, "targetMessageKey"))
writer.uint32(/* id 30, wireType 2 =*/242).string(message.targetMessageKey);
if (message.encPayload != null && Object.hasOwnProperty.call(message, "encPayload"))
writer.uint32(/* id 31, wireType 2 =*/250).bytes(message.encPayload);
if (message.encIv != null && Object.hasOwnProperty.call(message, "encIv"))
writer.uint32(/* id 32, wireType 2 =*/258).bytes(message.encIv);
if (message.eventName != null && Object.hasOwnProperty.call(message, "eventName"))
writer.uint32(/* id 33, wireType 2 =*/266).string(message.eventName);
if (message.isEventCanceled != null && Object.hasOwnProperty.call(message, "isEventCanceled"))
writer.uint32(/* id 34, wireType 0 =*/272).bool(message.isEventCanceled);
if (message.eventDescription != null && Object.hasOwnProperty.call(message, "eventDescription"))
writer.uint32(/* id 35, wireType 2 =*/282).string(message.eventDescription);
if (message.eventJoinLink != null && Object.hasOwnProperty.call(message, "eventJoinLink"))
writer.uint32(/* id 36, wireType 2 =*/290).string(message.eventJoinLink);
if (message.eventStartTime != null && Object.hasOwnProperty.call(message, "eventStartTime"))
writer.uint32(/* id 37, wireType 0 =*/296).int64(message.eventStartTime);
if (message.eventLocation != null && Object.hasOwnProperty.call(message, "eventLocation"))
$root.MdStorageMsgRowOpaqueData.MsgOpaqueData.EventLocation.encode(message.eventLocation, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim();
if (message.eventEndTime != null && Object.hasOwnProperty.call(message, "eventEndTime"))
writer.uint32(/* id 40, wireType 0 =*/320).int64(message.eventEndTime);
if (message.pollVotesSnapshot != null && Object.hasOwnProperty.call(message, "pollVotesSnapshot"))
$root.MdStorageMsgRowOpaqueData.MsgOpaqueData.PollVotesSnapshot.encode(message.pollVotesSnapshot, writer.uint32(/* id 41, wireType 2 =*/330).fork()).ldelim();
if (message.pollContentType != null && Object.hasOwnProperty.call(message, "pollContentType"))
writer.uint32(/* id 42, wireType 0 =*/336).int32(message.pollContentType);
if (message.plainProtobufBytes != null && Object.hasOwnProperty.call(message, "plainProtobufBytes"))
writer.uint32(/* id 43, wireType 2 =*/346).bytes(message.plainProtobufBytes);
if (message.eventIsScheduledCall != null && Object.hasOwnProperty.call(message, "eventIsScheduledCall"))
writer.uint32(/* id 44, wireType 0 =*/352).bool(message.eventIsScheduledCall);
if (message.eventExtraGuestsAllowed != null && Object.hasOwnProperty.call(message, "eventExtraGuestsAllowed"))
writer.uint32(/* id 45, wireType 0 =*/360).bool(message.eventExtraGuestsAllowed);
if (message.originalSelfAuthor != null && Object.hasOwnProperty.call(message, "originalSelfAuthor"))
writer.uint32(/* id 51, wireType 2 =*/410).string(message.originalSelfAuthor);
return writer;
};
/**
* Encodes the specified MsgOpaqueData message, length delimited. Does not implicitly {@link MdStorageMsgRowOpaqueData.MsgOpaqueData.verify|verify} messages.
* @function encodeDelimited
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @static
* @param {MdStorageMsgRowOpaqueData.IMsgOpaqueData} message MsgOpaqueData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
MsgOpaqueData.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a MsgOpaqueData message from the specified reader or buffer.
* @function decode
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {MdStorageMsgRowOpaqueData.MsgOpaqueData} MsgOpaqueData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
MsgOpaqueData.decode = function decode(reader, length, error) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.MdStorageMsgRowOpaqueData.MsgOpaqueData();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.body = reader.string();
break;
}
case 3: {
message.caption = reader.string();
break;
}
case 5: {
message.lng = reader.double();
break;
}
case 6: {
message.isLive = reader.bool();
break;
}
case 7: {
message.lat = reader.double();
break;
}
case 8: {
message.paymentAmount1000 = reader.int32();
break;
}
case 9: {
message.paymentNoteMsgBody = reader.string();
break;
}
case 11: {
message.matchedText = reader.string();
break;
}
case 12: {
message.title = reader.string();
break;
}
case 13: {
message.description = reader.string();
break;
}
case 14: {
message.futureproofBuffer = reader.bytes();
break;
}
case 15: {
message.clientUrl = reader.string();
break;
}
case 16: {
message.loc = reader.string();
break;
}
case 17: {
message.pollName = reader.string();
break;
}
case 18: {
if (!(message.pollOptions && message.pollOptions.length))
message.pollOptions = [];
message.pollOptions.push($root.MdStorageMsgRowOpaqueData.MsgOpaqueData.PollOption.decode(reader, reader.uint32()));
break;
}
case 20: {
message.pollSelectableOptionsCount = reader.uint32();
break;
}
case 21: {
message.messageSecret = reader.bytes();
break;
}
case 51: {
message.originalSelfAuthor = reader.string();
break;
}
case 22: {
message.senderTimestampMs = reader.int64();
break;
}
case 23: {
message.pollUpdateParentKey = reader.string();
break;
}
case 24: {
message.encPollVote = $root.E2E.Message.PollEncValue.decode(reader, reader.uint32());
break;
}
case 28: {
message.isSentCagPollCreation = reader.bool();
break;
}
case 42: {
message.pollContentType = reader.int32();
break;
}
case 41: {
message.pollVotesSnapshot = $root.MdStorageMsgRowOpaqueData.MsgOpaqueData.PollVotesSnapshot.decode(reader, reader.uint32());
break;
}
case 25: {
message.encReactionTargetMessageKey = reader.string();
break;
}
case 26: {
message.encReactionEncPayload = reader.bytes();
break;
}
case 27: {
message.encReactionEncIv = reader.bytes();
break;
}
case 29: {
message.botMessageSecret = reader.bytes();
break;
}
case 30: {
message.targetMessageKey = reader.string();
break;
}
case 31: {
message.encPayload = reader.bytes();
break;
}
case 32: {
message.encIv = reader.bytes();
break;
}
case 33: {
message.eventName = reader.string();
break;
}
case 34: {
message.isEventCanceled = reader.bool();
break;
}
case 35: {
message.eventDescription = reader.string();
break;
}
case 36: {
message.eventJoinLink = reader.string();
break;
}
case 37: {
message.eventStartTime = reader.int64();
break;
}
case 38: {
message.eventLocation = $root.MdStorageMsgRowOpaqueData.MsgOpaqueData.EventLocation.decode(reader, reader.uint32());
break;
}
case 40: {
message.eventEndTime = reader.int64();
break;
}
case 44: {
message.eventIsScheduledCall = reader.bool();
break;
}
case 45: {
message.eventExtraGuestsAllowed = reader.bool();
break;
}
case 43: {
message.plainProtobufBytes = reader.bytes();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a MsgOpaqueData message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {MdStorageMsgRowOpaqueData.MsgOpaqueData} MsgOpaqueData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
MsgOpaqueData.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a MsgOpaqueData message.
* @function verify
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
MsgOpaqueData.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.body != null && message.hasOwnProperty("body"))
if (!$util.isString(message.body))
return "body: string expected";
if (message.caption != null && message.hasOwnProperty("caption"))
if (!$util.isString(message.caption))
return "caption: string expected";
if (message.lng != null && message.hasOwnProperty("lng"))
if (typeof message.lng !== "number")
return "lng: number expected";
if (message.isLive != null && message.hasOwnProperty("isLive"))
if (typeof message.isLive !== "boolean")
return "isLive: boolean expected";
if (message.lat != null && message.hasOwnProperty("lat"))
if (typeof message.lat !== "number")
return "lat: number expected";
if (message.paymentAmount1000 != null && message.hasOwnProperty("paymentAmount1000"))
if (!$util.isInteger(message.paymentAmount1000))
return "paymentAmount1000: integer expected";
if (message.paymentNoteMsgBody != null && message.hasOwnProperty("paymentNoteMsgBody"))
if (!$util.isString(message.paymentNoteMsgBody))
return "paymentNoteMsgBody: string expected";
if (message.matchedText != null && message.hasOwnProperty("matchedText"))
if (!$util.isString(message.matchedText))
return "matchedText: string expected";
if (message.title != null && message.hasOwnProperty("title"))
if (!$util.isString(message.title))
return "title: string expected";
if (message.description != null && message.hasOwnProperty("description"))
if (!$util.isString(message.description))
return "description: string expected";
if (message.futureproofBuffer != null && message.hasOwnProperty("futureproofBuffer"))
if (!(message.futureproofBuffer && typeof message.futureproofBuffer.length === "number" || $util.isString(message.futureproofBuffer)))
return "futureproofBuffer: buffer expected";
if (message.clientUrl != null && message.hasOwnProperty("clientUrl"))
if (!$util.isString(message.clientUrl))
return "clientUrl: string expected";
if (message.loc != null && message.hasOwnProperty("loc"))
if (!$util.isString(message.loc))
return "loc: string expected";
if (message.pollName != null && message.hasOwnProperty("pollName"))
if (!$util.isString(message.pollName))
return "pollName: string expected";
if (message.pollOptions != null && message.hasOwnProperty("pollOptions")) {
if (!Array.isArray(message.pollOptions))
return "pollOptions: array expected";
for (var i = 0; i < message.pollOptions.length; ++i) {
var error = $root.MdStorageMsgRowOpaqueData.MsgOpaqueData.PollOption.verify(message.pollOptions[i]);
if (error)
return "pollOptions." + error;
}
}
if (message.pollSelectableOptionsCount != null && message.hasOwnProperty("pollSelectableOptionsCount"))
if (!$util.isInteger(message.pollSelectableOptionsCount))
return "pollSelectableOptionsCount: integer expected";
if (message.messageSecret != null && message.hasOwnProperty("messageSecret"))
if (!(message.messageSecret && typeof message.messageSecret.length === "number" || $util.isString(message.messageSecret)))
return "messageSecret: buffer expected";
if (message.originalSelfAuthor != null && message.hasOwnProperty("originalSelfAuthor"))
if (!$util.isString(message.originalSelfAuthor))
return "originalSelfAuthor: string expected";
if (message.senderTimestampMs != null && message.hasOwnProperty("senderTimestampMs"))
if (!$util.isInteger(message.senderTimestampMs) && !(message.senderTimestampMs && $util.isInteger(message.senderTimestampMs.low) && $util.isInteger(message.senderTimestampMs.high)))
return "senderTimestampMs: integer|Long expected";
if (message.pollUpdateParentKey != null && message.hasOwnProperty("pollUpdateParentKey"))
if (!$util.isString(message.pollUpdateParentKey))
return "pollUpdateParentKey: string expected";
if (message.encPollVote != null && message.hasOwnProperty("encPollVote")) {
var error = $root.E2E.Message.PollEncValue.verify(message.encPollVote);
if (error)
return "encPollVote." + error;
}
if (message.isSentCagPollCreation != null && message.hasOwnProperty("isSentCagPollCreation"))
if (typeof message.isSentCagPollCreation !== "boolean")
return "isSentCagPollCreation: boolean expected";
if (message.pollContentType != null && message.hasOwnProperty("pollContentType"))
switch (message.pollContentType) {
default:
return "pollContentType: enum value expected";
case 0:
case 1:
case 2:
break;
}
if (message.pollVotesSnapshot != null && message.hasOwnProperty("pollVotesSnapshot")) {
var error = $root.MdStorageMsgRowOpaqueData.MsgOpaqueData.PollVotesSnapshot.verify(message.pollVotesSnapshot);
if (error)
return "pollVotesSnapshot." + error;
}
if (message.encReactionTargetMessageKey != null && message.hasOwnProperty("encReactionTargetMessageKey"))
if (!$util.isString(message.encReactionTargetMessageKey))
return "encReactionTargetMessageKey: string expected";
if (message.encReactionEncPayload != null && message.hasOwnProperty("encReactionEncPayload"))
if (!(message.encReactionEncPayload && typeof message.encReactionEncPayload.length === "number" || $util.isString(message.encReactionEncPayload)))
return "encReactionEncPayload: buffer expected";
if (message.encReactionEncIv != null && message.hasOwnProperty("encReactionEncIv"))
if (!(message.encReactionEncIv && typeof message.encReactionEncIv.length === "number" || $util.isString(message.encReactionEncIv)))
return "encReactionEncIv: buffer expected";
if (message.botMessageSecret != null && message.hasOwnProperty("botMessageSecret"))
if (!(message.botMessageSecret && typeof message.botMessageSecret.length === "number" || $util.isString(message.botMessageSecret)))
return "botMessageSecret: buffer expected";
if (message.targetMessageKey != null && message.hasOwnProperty("targetMessageKey"))
if (!$util.isString(message.targetMessageKey))
return "targetMessageKey: string expected";
if (message.encPayload != null && message.hasOwnProperty("encPayload"))
if (!(message.encPayload && typeof message.encPayload.length === "number" || $util.isString(message.encPayload)))
return "encPayload: buffer expected";
if (message.encIv != null && message.hasOwnProperty("encIv"))
if (!(message.encIv && typeof message.encIv.length === "number" || $util.isString(message.encIv)))
return "encIv: buffer expected";
if (message.eventName != null && message.hasOwnProperty("eventName"))
if (!$util.isString(message.eventName))
return "eventName: string expected";
if (message.isEventCanceled != null && message.hasOwnProperty("isEventCanceled"))
if (typeof message.isEventCanceled !== "boolean")
return "isEventCanceled: boolean expected";
if (message.eventDescription != null && message.hasOwnProperty("eventDescription"))
if (!$util.isString(message.eventDescription))
return "eventDescription: string expected";
if (message.eventJoinLink != null && message.hasOwnProperty("eventJoinLink"))
if (!$util.isString(message.eventJoinLink))
return "eventJoinLink: string expected";
if (message.eventStartTime != null && message.hasOwnProperty("eventStartTime"))
if (!$util.isInteger(message.eventStartTime) && !(message.eventStartTime && $util.isInteger(message.eventStartTime.low) && $util.isInteger(message.eventStartTime.high)))
return "eventStartTime: integer|Long expected";
if (message.eventLocation != null && message.hasOwnProperty("eventLocation")) {
var error = $root.MdStorageMsgRowOpaqueData.MsgOpaqueData.EventLocation.verify(message.eventLocation);
if (error)
return "eventLocation." + error;
}
if (message.eventEndTime != null && message.hasOwnProperty("eventEndTime"))
if (!$util.isInteger(message.eventEndTime) && !(message.eventEndTime && $util.isInteger(message.eventEndTime.low) && $util.isInteger(message.eventEndTime.high)))
return "eventEndTime: integer|Long expected";
if (message.eventIsScheduledCall != null && message.hasOwnProperty("eventIsScheduledCall"))
if (typeof message.eventIsScheduledCall !== "boolean")
return "eventIsScheduledCall: boolean expected";
if (message.eventExtraGuestsAllowed != null && message.hasOwnProperty("eventExtraGuestsAllowed"))
if (typeof message.eventExtraGuestsAllowed !== "boolean")
return "eventExtraGuestsAllowed: boolean expected";
if (message.plainProtobufBytes != null && message.hasOwnProperty("plainProtobufBytes"))
if (!(message.plainProtobufBytes && typeof message.plainProtobufBytes.length === "number" || $util.isString(message.plainProtobufBytes)))
return "plainProtobufBytes: buffer expected";
return null;
};
/**
* Creates a MsgOpaqueData message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof MdStorageMsgRowOpaqueData.MsgOpaqueData
* @static
* @param {Object.<string,*>} object Plain object
* @returns {MdStorageMsgRowOpaqueData.MsgOpaqueData} MsgOpaqueData
*/
MsgOpaqueData.fromObject = function fromObject(object) {
if (object instanceof $root.MdStorageMsgRowOpaqueData.MsgOpaqueData)
return object;
var message = new $root.MdStorageMsgRowOpaqueData.MsgOpaqueData();
if (object.body != null)
message.body = String(object.body);
if (object.caption != null)
message.caption = String(object.caption);
if (object.lng != null)
message.lng = Number(object.lng);
if (object.isLive != null)
message.isLive = Boolean(object.isLive);
if (object.lat != null)
message.lat = Number(object.lat);
if (object.paymentAmount1000 != null)
message.paymentAmount1000 = object.paymentAmount1000 | 0;
if (object.paymentNoteMsgBody != null)
message.paymentNoteMsgBody = String(object.paymentNoteMsgBody);
if (object.matchedText != null)
message.matchedText = String(object.matchedText);
if (object.title != null)
message.title = String(object.title);
if (object.description != null)
message.description = String(object.description);
if (object.futureproofBuffer != null)
if (typeof object.futureproofBuffer === "string")
$util.base64.decode(object.futureproofBuffer, message.futureproofBuffer = $util.newBuffer($util.base64.length(object.futureproofBuffer)), 0);
else if (object.futureproofBuffer.length >= 0)
message.futureproofBuffer = object.futureproofBuffer;
if (object.clientUrl != null)
message.clientUrl = String(object.clientUrl);
if (object.loc != null)
message.loc = String(object.loc);
if (object.pollName != null)
message.pollName = String(object.pollName);
if (object.pollOptions) {
if (!Array.isArray(object.pollOptions))
throw TypeError(".MdStorageMsgRowOpaqueData.MsgOpaqueData.pollOptions: array expected");
message.pollOptions = [];
for (var i = 0; i < object.pollOptions.length; ++i) {
if (typeof object.pollOptions[i] !== "object")
throw TypeError(".MdStorageMsgRowOpaqueData.MsgOpaqueData.pollOptions: object expected");
message.pollOptions[i] = $root.MdStorageMsgRowOpaqueData.MsgOpaqueData.PollOption.fromObject(object.pollOptions[i]);
}
}
if (object.pollSelectableOptionsCount != null)
message.pollSelectableOptionsCount = object.pollSelectableOptionsCount >>> 0;
if (object.messageSecret != null)
if (typeof object.messageSecret === "string")
$util.base64.decode(object.messageSecret, message.messageSecret = $util.newBuffer($util.base64.length(object.messageSecret)), 0);
else if (object.messageSecret.length >= 0)
message.messageSecret = object.messageSecret;
if (object.originalSelfAuthor != null)
message.originalSelfAuthor = String(object.originalSelfAuthor);
if (object.senderTimestampMs != null)
if ($util.Long)
(message.senderTimestampMs = $util.Long.fromValue(object.senderTimestampMs)).unsigned = false;
else if (typeof object.senderTimestampMs === "string")
message.senderTimestampMs = parseInt(object.senderTimestampMs, 10);
else if (typeof object.senderTimestampMs === "number")
message.senderTimestampMs = object.senderTimestampMs;
else if (typeof object.senderTimestampMs === "object")
message.senderTimestampMs = new $util.LongBits(object.senderTimestampMs.low >>> 0, object.senderTimestampMs.high >>> 0).toNumber();
if (object.pollUpdateParentKey != null)
message.pollUpdateParentKey = String(object.pollUpdateParentKey);
if (object.encPollVote != null) {
if (typeof object.encPollVote !== "object")
throw TypeError(".MdStorageMsgRowOpaqueData.MsgOpaqueData.encPollVote: object expected");