UNPKG

secret-company-ltd

Version:
1,136 lines (1,049 loc) 6.99 MB
/*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.HistorySync = (function() { /** * Namespace HistorySync. * @exports HistorySync * @namespace */ var HistorySync = {}; HistorySync.NotificationSettings = (function() { /** * Properties of a NotificationSettings. * @memberof HistorySync * @interface INotificationSettings * @property {string|null} [messageVibrate] NotificationSettings messageVibrate * @property {string|null} [messagePopup] NotificationSettings messagePopup * @property {string|null} [messageLight] NotificationSettings messageLight * @property {boolean|null} [lowPriorityNotifications] NotificationSettings lowPriorityNotifications * @property {boolean|null} [reactionsMuted] NotificationSettings reactionsMuted * @property {string|null} [callVibrate] NotificationSettings callVibrate */ /** * Constructs a new NotificationSettings. * @memberof HistorySync * @classdesc Represents a NotificationSettings. * @implements INotificationSettings * @constructor * @param {HistorySync.INotificationSettings=} [properties] Properties to set */ function NotificationSettings(properties) { 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]]; } /** * NotificationSettings messageVibrate. * @member {string|null|undefined} messageVibrate * @memberof HistorySync.NotificationSettings * @instance */ NotificationSettings.prototype.messageVibrate = null; /** * NotificationSettings messagePopup. * @member {string|null|undefined} messagePopup * @memberof HistorySync.NotificationSettings * @instance */ NotificationSettings.prototype.messagePopup = null; /** * NotificationSettings messageLight. * @member {string|null|undefined} messageLight * @memberof HistorySync.NotificationSettings * @instance */ NotificationSettings.prototype.messageLight = null; /** * NotificationSettings lowPriorityNotifications. * @member {boolean|null|undefined} lowPriorityNotifications * @memberof HistorySync.NotificationSettings * @instance */ NotificationSettings.prototype.lowPriorityNotifications = null; /** * NotificationSettings reactionsMuted. * @member {boolean|null|undefined} reactionsMuted * @memberof HistorySync.NotificationSettings * @instance */ NotificationSettings.prototype.reactionsMuted = null; /** * NotificationSettings callVibrate. * @member {string|null|undefined} callVibrate * @memberof HistorySync.NotificationSettings * @instance */ NotificationSettings.prototype.callVibrate = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; // Virtual OneOf for proto3 optional field Object.defineProperty(NotificationSettings.prototype, "_messageVibrate", { get: $util.oneOfGetter($oneOfFields = ["messageVibrate"]), set: $util.oneOfSetter($oneOfFields) }); // Virtual OneOf for proto3 optional field Object.defineProperty(NotificationSettings.prototype, "_messagePopup", { get: $util.oneOfGetter($oneOfFields = ["messagePopup"]), set: $util.oneOfSetter($oneOfFields) }); // Virtual OneOf for proto3 optional field Object.defineProperty(NotificationSettings.prototype, "_messageLight", { get: $util.oneOfGetter($oneOfFields = ["messageLight"]), set: $util.oneOfSetter($oneOfFields) }); // Virtual OneOf for proto3 optional field Object.defineProperty(NotificationSettings.prototype, "_lowPriorityNotifications", { get: $util.oneOfGetter($oneOfFields = ["lowPriorityNotifications"]), set: $util.oneOfSetter($oneOfFields) }); // Virtual OneOf for proto3 optional field Object.defineProperty(NotificationSettings.prototype, "_reactionsMuted", { get: $util.oneOfGetter($oneOfFields = ["reactionsMuted"]), set: $util.oneOfSetter($oneOfFields) }); // Virtual OneOf for proto3 optional field Object.defineProperty(NotificationSettings.prototype, "_callVibrate", { get: $util.oneOfGetter($oneOfFields = ["callVibrate"]), set: $util.oneOfSetter($oneOfFields) }); /** * Creates a new NotificationSettings instance using the specified properties. * @function create * @memberof HistorySync.NotificationSettings * @static * @param {HistorySync.INotificationSettings=} [properties] Properties to set * @returns {HistorySync.NotificationSettings} NotificationSettings instance */ NotificationSettings.create = function create(properties) { return new NotificationSettings(properties); }; /** * Encodes the specified NotificationSettings message. Does not implicitly {@link HistorySync.NotificationSettings.verify|verify} messages. * @function encode * @memberof HistorySync.NotificationSettings * @static * @param {HistorySync.INotificationSettings} message NotificationSettings message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ NotificationSettings.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.messageVibrate != null && Object.hasOwnProperty.call(message, "messageVibrate")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.messageVibrate); if (message.messagePopup != null && Object.hasOwnProperty.call(message, "messagePopup")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.messagePopup); if (message.messageLight != null && Object.hasOwnProperty.call(message, "messageLight")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.messageLight); if (message.lowPriorityNotifications != null && Object.hasOwnProperty.call(message, "lowPriorityNotifications")) writer.uint32(/* id 4, wireType 0 =*/32).bool(message.lowPriorityNotifications); if (message.reactionsMuted != null && Object.hasOwnProperty.call(message, "reactionsMuted")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reactionsMuted); if (message.callVibrate != null && Object.hasOwnProperty.call(message, "callVibrate")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.callVibrate); return writer; }; /** * Encodes the specified NotificationSettings message, length delimited. Does not implicitly {@link HistorySync.NotificationSettings.verify|verify} messages. * @function encodeDelimited * @memberof HistorySync.NotificationSettings * @static * @param {HistorySync.INotificationSettings} message NotificationSettings message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ NotificationSettings.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a NotificationSettings message from the specified reader or buffer. * @function decode * @memberof HistorySync.NotificationSettings * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {HistorySync.NotificationSettings} NotificationSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ NotificationSettings.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.HistorySync.NotificationSettings(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { message.messageVibrate = reader.string(); break; } case 2: { message.messagePopup = reader.string(); break; } case 3: { message.messageLight = reader.string(); break; } case 4: { message.lowPriorityNotifications = reader.bool(); break; } case 5: { message.reactionsMuted = reader.bool(); break; } case 6: { message.callVibrate = reader.string(); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a NotificationSettings message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof HistorySync.NotificationSettings * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {HistorySync.NotificationSettings} NotificationSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ NotificationSettings.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a NotificationSettings message. * @function verify * @memberof HistorySync.NotificationSettings * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ NotificationSettings.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; if (message.messageVibrate != null && message.hasOwnProperty("messageVibrate")) { properties._messageVibrate = 1; if (!$util.isString(message.messageVibrate)) return "messageVibrate: string expected"; } if (message.messagePopup != null && message.hasOwnProperty("messagePopup")) { properties._messagePopup = 1; if (!$util.isString(message.messagePopup)) return "messagePopup: string expected"; } if (message.messageLight != null && message.hasOwnProperty("messageLight")) { properties._messageLight = 1; if (!$util.isString(message.messageLight)) return "messageLight: string expected"; } if (message.lowPriorityNotifications != null && message.hasOwnProperty("lowPriorityNotifications")) { properties._lowPriorityNotifications = 1; if (typeof message.lowPriorityNotifications !== "boolean") return "lowPriorityNotifications: boolean expected"; } if (message.reactionsMuted != null && message.hasOwnProperty("reactionsMuted")) { properties._reactionsMuted = 1; if (typeof message.reactionsMuted !== "boolean") return "reactionsMuted: boolean expected"; } if (message.callVibrate != null && message.hasOwnProperty("callVibrate")) { properties._callVibrate = 1; if (!$util.isString(message.callVibrate)) return "callVibrate: string expected"; } return null; }; /** * Creates a NotificationSettings message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof HistorySync.NotificationSettings * @static * @param {Object.<string,*>} object Plain object * @returns {HistorySync.NotificationSettings} NotificationSettings */ NotificationSettings.fromObject = function fromObject(object) { if (object instanceof $root.HistorySync.NotificationSettings) return object; var message = new $root.HistorySync.NotificationSettings(); if (object.messageVibrate != null) message.messageVibrate = String(object.messageVibrate); if (object.messagePopup != null) message.messagePopup = String(object.messagePopup); if (object.messageLight != null) message.messageLight = String(object.messageLight); if (object.lowPriorityNotifications != null) message.lowPriorityNotifications = Boolean(object.lowPriorityNotifications); if (object.reactionsMuted != null) message.reactionsMuted = Boolean(object.reactionsMuted); if (object.callVibrate != null) message.callVibrate = String(object.callVibrate); return message; }; /** * Creates a plain object from a NotificationSettings message. Also converts values to other types if specified. * @function toObject * @memberof HistorySync.NotificationSettings * @static * @param {HistorySync.NotificationSettings} message NotificationSettings * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ NotificationSettings.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (message.messageVibrate != null && message.hasOwnProperty("messageVibrate")) { object.messageVibrate = message.messageVibrate; if (options.oneofs) object._messageVibrate = "messageVibrate"; } if (message.messagePopup != null && message.hasOwnProperty("messagePopup")) { object.messagePopup = message.messagePopup; if (options.oneofs) object._messagePopup = "messagePopup"; } if (message.messageLight != null && message.hasOwnProperty("messageLight")) { object.messageLight = message.messageLight; if (options.oneofs) object._messageLight = "messageLight"; } if (message.lowPriorityNotifications != null && message.hasOwnProperty("lowPriorityNotifications")) { object.lowPriorityNotifications = message.lowPriorityNotifications; if (options.oneofs) object._lowPriorityNotifications = "lowPriorityNotifications"; } if (message.reactionsMuted != null && message.hasOwnProperty("reactionsMuted")) { object.reactionsMuted = message.reactionsMuted; if (options.oneofs) object._reactionsMuted = "reactionsMuted"; } if (message.callVibrate != null && message.hasOwnProperty("callVibrate")) { object.callVibrate = message.callVibrate; if (options.oneofs) object._callVibrate = "callVibrate"; } return object; }; /** * Converts this NotificationSettings to JSON. * @function toJSON * @memberof HistorySync.NotificationSettings * @instance * @returns {Object.<string,*>} JSON object */ NotificationSettings.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for NotificationSettings * @function getTypeUrl * @memberof HistorySync.NotificationSettings * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ NotificationSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/HistorySync.NotificationSettings"; }; return NotificationSettings; })(); HistorySync.AvatarUserSettings = (function() { /** * Properties of an AvatarUserSettings. * @memberof HistorySync * @interface IAvatarUserSettings * @property {string|null} [fbid] AvatarUserSettings fbid * @property {string|null} [password] AvatarUserSettings password */ /** * Constructs a new AvatarUserSettings. * @memberof HistorySync * @classdesc Represents an AvatarUserSettings. * @implements IAvatarUserSettings * @constructor * @param {HistorySync.IAvatarUserSettings=} [properties] Properties to set */ function AvatarUserSettings(properties) { 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]]; } /** * AvatarUserSettings fbid. * @member {string|null|undefined} fbid * @memberof HistorySync.AvatarUserSettings * @instance */ AvatarUserSettings.prototype.fbid = null; /** * AvatarUserSettings password. * @member {string|null|undefined} password * @memberof HistorySync.AvatarUserSettings * @instance */ AvatarUserSettings.prototype.password = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; // Virtual OneOf for proto3 optional field Object.defineProperty(AvatarUserSettings.prototype, "_fbid", { get: $util.oneOfGetter($oneOfFields = ["fbid"]), set: $util.oneOfSetter($oneOfFields) }); // Virtual OneOf for proto3 optional field Object.defineProperty(AvatarUserSettings.prototype, "_password", { get: $util.oneOfGetter($oneOfFields = ["password"]), set: $util.oneOfSetter($oneOfFields) }); /** * Creates a new AvatarUserSettings instance using the specified properties. * @function create * @memberof HistorySync.AvatarUserSettings * @static * @param {HistorySync.IAvatarUserSettings=} [properties] Properties to set * @returns {HistorySync.AvatarUserSettings} AvatarUserSettings instance */ AvatarUserSettings.create = function create(properties) { return new AvatarUserSettings(properties); }; /** * Encodes the specified AvatarUserSettings message. Does not implicitly {@link HistorySync.AvatarUserSettings.verify|verify} messages. * @function encode * @memberof HistorySync.AvatarUserSettings * @static * @param {HistorySync.IAvatarUserSettings} message AvatarUserSettings message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ AvatarUserSettings.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.fbid != null && Object.hasOwnProperty.call(message, "fbid")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.fbid); if (message.password != null && Object.hasOwnProperty.call(message, "password")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.password); return writer; }; /** * Encodes the specified AvatarUserSettings message, length delimited. Does not implicitly {@link HistorySync.AvatarUserSettings.verify|verify} messages. * @function encodeDelimited * @memberof HistorySync.AvatarUserSettings * @static * @param {HistorySync.IAvatarUserSettings} message AvatarUserSettings message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ AvatarUserSettings.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an AvatarUserSettings message from the specified reader or buffer. * @function decode * @memberof HistorySync.AvatarUserSettings * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {HistorySync.AvatarUserSettings} AvatarUserSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ AvatarUserSettings.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.HistorySync.AvatarUserSettings(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { message.fbid = reader.string(); break; } case 2: { message.password = reader.string(); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an AvatarUserSettings message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof HistorySync.AvatarUserSettings * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {HistorySync.AvatarUserSettings} AvatarUserSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ AvatarUserSettings.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an AvatarUserSettings message. * @function verify * @memberof HistorySync.AvatarUserSettings * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ AvatarUserSettings.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; if (message.fbid != null && message.hasOwnProperty("fbid")) { properties._fbid = 1; if (!$util.isString(message.fbid)) return "fbid: string expected"; } if (message.password != null && message.hasOwnProperty("password")) { properties._password = 1; if (!$util.isString(message.password)) return "password: string expected"; } return null; }; /** * Creates an AvatarUserSettings message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof HistorySync.AvatarUserSettings * @static * @param {Object.<string,*>} object Plain object * @returns {HistorySync.AvatarUserSettings} AvatarUserSettings */ AvatarUserSettings.fromObject = function fromObject(object) { if (object instanceof $root.HistorySync.AvatarUserSettings) return object; var message = new $root.HistorySync.AvatarUserSettings(); if (object.fbid != null) message.fbid = String(object.fbid); if (object.password != null) message.password = String(object.password); return message; }; /** * Creates a plain object from an AvatarUserSettings message. Also converts values to other types if specified. * @function toObject * @memberof HistorySync.AvatarUserSettings * @static * @param {HistorySync.AvatarUserSettings} message AvatarUserSettings * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ AvatarUserSettings.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (message.fbid != null && message.hasOwnProperty("fbid")) { object.fbid = message.fbid; if (options.oneofs) object._fbid = "fbid"; } if (message.password != null && message.hasOwnProperty("password")) { object.password = message.password; if (options.oneofs) object._password = "password"; } return object; }; /** * Converts this AvatarUserSettings to JSON. * @function toJSON * @memberof HistorySync.AvatarUserSettings * @instance * @returns {Object.<string,*>} JSON object */ AvatarUserSettings.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for AvatarUserSettings * @function getTypeUrl * @memberof HistorySync.AvatarUserSettings * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ AvatarUserSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/HistorySync.AvatarUserSettings"; }; return AvatarUserSettings; })(); HistorySync.PastParticipant = (function() { /** * Properties of a PastParticipant. * @memberof HistorySync * @interface IPastParticipant * @property {string|null} [userJid] PastParticipant userJid * @property {HistorySync.PastParticipant.LeaveReason|null} [leaveReason] PastParticipant leaveReason * @property {number|Long|null} [leaveTs] PastParticipant leaveTs */ /** * Constructs a new PastParticipant. * @memberof HistorySync * @classdesc Represents a PastParticipant. * @implements IPastParticipant * @constructor * @param {HistorySync.IPastParticipant=} [properties] Properties to set */ function PastParticipant(properties) { 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]]; } /** * PastParticipant userJid. * @member {string|null|undefined} userJid * @memberof HistorySync.PastParticipant * @instance */ PastParticipant.prototype.userJid = null; /** * PastParticipant leaveReason. * @member {HistorySync.PastParticipant.LeaveReason|null|undefined} leaveReason * @memberof HistorySync.PastParticipant * @instance */ PastParticipant.prototype.leaveReason = null; /** * PastParticipant leaveTs. * @member {number|Long|null|undefined} leaveTs * @memberof HistorySync.PastParticipant * @instance */ PastParticipant.prototype.leaveTs = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; // Virtual OneOf for proto3 optional field Object.defineProperty(PastParticipant.prototype, "_userJid", { get: $util.oneOfGetter($oneOfFields = ["userJid"]), set: $util.oneOfSetter($oneOfFields) }); // Virtual OneOf for proto3 optional field Object.defineProperty(PastParticipant.prototype, "_leaveReason", { get: $util.oneOfGetter($oneOfFields = ["leaveReason"]), set: $util.oneOfSetter($oneOfFields) }); // Virtual OneOf for proto3 optional field Object.defineProperty(PastParticipant.prototype, "_leaveTs", { get: $util.oneOfGetter($oneOfFields = ["leaveTs"]), set: $util.oneOfSetter($oneOfFields) }); /** * Creates a new PastParticipant instance using the specified properties. * @function create * @memberof HistorySync.PastParticipant * @static * @param {HistorySync.IPastParticipant=} [properties] Properties to set * @returns {HistorySync.PastParticipant} PastParticipant instance */ PastParticipant.create = function create(properties) { return new PastParticipant(properties); }; /** * Encodes the specified PastParticipant message. Does not implicitly {@link HistorySync.PastParticipant.verify|verify} messages. * @function encode * @memberof HistorySync.PastParticipant * @static * @param {HistorySync.IPastParticipant} message PastParticipant message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ PastParticipant.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.userJid != null && Object.hasOwnProperty.call(message, "userJid")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.userJid); if (message.leaveReason != null && Object.hasOwnProperty.call(message, "leaveReason")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.leaveReason); if (message.leaveTs != null && Object.hasOwnProperty.call(message, "leaveTs")) writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.leaveTs); return writer; }; /** * Encodes the specified PastParticipant message, length delimited. Does not implicitly {@link HistorySync.PastParticipant.verify|verify} messages. * @function encodeDelimited * @memberof HistorySync.PastParticipant * @static * @param {HistorySync.IPastParticipant} message PastParticipant message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ PastParticipant.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a PastParticipant message from the specified reader or buffer. * @function decode * @memberof HistorySync.PastParticipant * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {HistorySync.PastParticipant} PastParticipant * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ PastParticipant.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.HistorySync.PastParticipant(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { message.userJid = reader.string(); break; } case 2: { message.leaveReason = reader.int32(); break; } case 3: { message.leaveTs = reader.uint64(); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a PastParticipant message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof HistorySync.PastParticipant * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {HistorySync.PastParticipant} PastParticipant * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ PastParticipant.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a PastParticipant message. * @function verify * @memberof HistorySync.PastParticipant * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ PastParticipant.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; if (message.userJid != null && message.hasOwnProperty("userJid")) { properties._userJid = 1; if (!$util.isString(message.userJid)) return "userJid: string expected"; } if (message.leaveReason != null && message.hasOwnProperty("leaveReason")) { properties._leaveReason = 1; switch (message.leaveReason) { default: return "leaveReason: enum value expected"; case 0: case 1: break; } } if (message.leaveTs != null && message.hasOwnProperty("leaveTs")) { properties._leaveTs = 1; if (!$util.isInteger(message.leaveTs) && !(message.leaveTs && $util.isInteger(message.leaveTs.low) && $util.isInteger(message.leaveTs.high))) return "leaveTs: integer|Long expected"; } return null; }; /** * Creates a PastParticipant message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof HistorySync.PastParticipant * @static * @param {Object.<string,*>} object Plain object * @returns {HistorySync.PastParticipant} PastParticipant */ PastParticipant.fromObject = function fromObject(object) { if (object instanceof $root.HistorySync.PastParticipant) return object; var message = new $root.HistorySync.PastParticipant(); if (object.userJid != null) message.userJid = String(object.userJid); switch (object.leaveReason) { default: if (typeof object.leaveReason === "number") { message.leaveReason = object.leaveReason; break; } break; case "LEFT": case 0: message.leaveReason = 0; break; case "REMOVED": case 1: message.leaveReason = 1; break; } if (object.leaveTs != null) if ($util.Long) (message.leaveTs = $util.Long.fromValue(object.leaveTs)).unsigned = true; else if (typeof object.leaveTs === "string") message.leaveTs = parseInt(object.leaveTs, 10); else if (typeof object.leaveTs === "number") message.leaveTs = object.leaveTs; else if (typeof object.leaveTs === "object") message.leaveTs = new $util.LongBits(object.leaveTs.low >>> 0, object.leaveTs.high >>> 0).toNumber(true); return message; }; /** * Creates a plain object from a PastParticipant message. Also converts values to other types if specified. * @function toObject * @memberof HistorySync.PastParticipant * @static * @param {HistorySync.PastParticipant} message PastParticipant * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ PastParticipant.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (message.userJid != null && message.hasOwnProperty("userJid")) { object.userJid = message.userJid; if (options.oneofs) object._userJid = "userJid"; } if (message.leaveReason != null && message.hasOwnProperty("leaveReason")) { object.leaveReason = options.enums === String ? $root.HistorySync.PastParticipant.LeaveReason[message.leaveReason] === undefined ? message.leaveReason : $root.HistorySync.PastParticipant.LeaveReason[message.leaveReason] : message.leaveReason; if (options.oneofs) object._leaveReason = "leaveReason"; } if (message.leaveTs != null && message.hasOwnProperty("leaveTs")) { if (typeof message.leaveTs === "number") object.leaveTs = options.longs === String ? String(message.leaveTs) : message.leaveTs; else object.leaveTs = options.longs === String ? $util.Long.prototype.toString.call(message.leaveTs) : options.longs === Number ? new $util.LongBits(message.leaveTs.low >>> 0, message.leaveTs.high >>> 0).toNumber(true) : message.leaveTs; if (options.oneofs) object._leaveTs = "leaveTs"; } return object; }; /** * Converts this PastParticipant to JSON. * @function toJSON * @memberof HistorySync.PastParticipant * @instance * @returns {Object.<string,*>} JSON object */ PastParticipant.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for PastParticipant * @function getTypeUrl * @memberof HistorySync.PastParticipant * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ PastParticipant.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/HistorySync.PastParticipant"; }; /** * LeaveReason enum. * @name HistorySync.PastParticipant.LeaveReason * @enum {number} * @property {number} LEFT=0 LEFT value * @property {number} REMOVED=1 REMOVED value */ PastParticipant.LeaveReason = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "LEFT"] = 0; values[valuesById[1] = "REMOVED"] = 1; return values; })(); return PastParticipant; })(); HistorySync.PastParticipants = (function() { /** * Properties of a PastParticipants. * @memberof HistorySync * @interface IPastParticipants * @property {string|null} [groupJid] PastParticipants groupJid * @property {Array.<HistorySync.IPastParticipant>|null} [pastParticipants] PastParticipants pastParticipants */ /** * Constructs a new PastParticipants. * @memberof HistorySync * @classdesc Represents a PastParticipants. * @implements IPastParticipants * @constructor * @param {HistorySync.IPastParticipants=} [properties] Properties to set */ function PastParticipants(properties) { this.pastParticipants = []; 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]]; } /** * PastParticipants groupJid. * @member {string|null|undefined} groupJid * @memberof HistorySync.PastParticipants * @instance */ PastParticipants.prototype.groupJid = null; /** * PastParticipants pastParticipants. * @member {Array.<HistorySync.IPastParticipant>} pastParticipants * @memberof HistorySync.PastParticipants * @instance */ PastParticipants.prototype.pastParticipants = $util.emptyArray; // OneOf field names bound to virtual getters and setters var $oneOfFields; // Virtual OneOf for proto3 optional field Object.defineProperty(PastParticipants.prototype, "_groupJid", { get: $util.oneOfGetter($oneOfFields = ["groupJid"]), set: $util.oneOfSetter($oneOfFields) }); /** * Creates a new PastParticipants instance using the specified properties. * @function create * @memberof HistorySync.PastParticipants * @static * @param {HistorySync.IPastParticipants=} [properties] Properties to set * @returns {HistorySync.PastParticipants} PastParticipants instance */ PastParticipants.create = function create(properties) { return new PastParticipants(properties); }; /** * Encodes the specified PastParticipants message. Does not implicitly {@link HistorySync.PastParticipants.verify|verify} messages. * @function encode * @memberof HistorySync.PastParticipants * @static * @param {HistorySync.IPastParticipants} message PastParticipants message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ PastParticipants.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.groupJid != null && Object.hasOwnProperty.call(message, "groupJid")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.groupJid); if (message.pastParticipants != null && message.pastParticipants.length) for (var i = 0; i < message.pastParticipants.length; ++i) $root.HistorySync.PastParticipant.encode(message.pastParticipants[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** * Encodes the specified PastParticipants message, length delimited. Does not implicitly {@link HistorySync.PastParticipants.verify|verify} messages. * @function encodeDelimited * @memberof HistorySync.PastParticipants * @static * @param {HistorySync.IPastParticipants} message PastParticipants message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ PastParticipants.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a PastParticipants message from the specified reader or buffer. * @function decode * @memberof HistorySync.PastParticipants * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {HistorySync.PastParticipants} PastParticipants * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ PastParticipants.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.HistorySync.PastParticipants(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { message.groupJid = reader.string(); break; } case 2: { if (!(message.pastParticipants && message.pastParticipants.length)) message.pastParticipants = []; message.pastParticipants.push($root.HistorySync.PastParticipant.decode(reader, reader.uint32())); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a PastParticipants message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof HistorySync.PastParticipants * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {HistorySync.PastParticipants} PastParticipants * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ PastParticipants.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a PastParticipants message. * @function verify * @memberof HistorySync.PastParticipants * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ PastParticipants.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {};