diff --git a/WAProto/fix-imports.js b/WAProto/fix-imports.js index baa91413..43a43be1 100644 --- a/WAProto/fix-imports.js +++ b/WAProto/fix-imports.js @@ -1,29 +1,81 @@ import { readFileSync, writeFileSync } from 'fs'; import { exit } from 'process'; -const filePath = './index.js'; +const filePath = './index.js' try { - // Read the file - let content = readFileSync(filePath, 'utf8'); + let content = readFileSync(filePath, 'utf8') - // Fix the import statement - content = content.replace( - /import \* as (\$protobuf) from/g, - 'import $1 from' - ); + content = content.replace(/import \* as (\$protobuf) from/g, 'import $1 from') + content = content.replace(/(['"])protobufjs\/minimal(['"])/g, '$1protobufjs/minimal.js$2') - // add missing extension to the import - content = content.replace( - /(['"])protobufjs\/minimal(['"])/g, - '$1protobufjs/minimal.js$2' - ); + const marker = 'const $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});\n\n' + const longToStringHelper = + 'function longToString(value, unsigned) {\n' + + '\tif (typeof value === "string") {\n' + + '\t\treturn value;\n' + + '\t}\n' + + '\tif (typeof value === "number") {\n' + + '\t\treturn String(value);\n' + + '\t}\n' + + '\tif (!$util.Long) {\n' + + '\t\treturn String(value);\n' + + '\t}\n' + + '\tconst normalized = $util.Long.fromValue(value);\n' + + '\tconst prepared = unsigned && normalized && typeof normalized.toUnsigned === "function"\n' + + '\t\t? normalized.toUnsigned()\n' + + '\t\t: normalized;\n' + + '\treturn prepared.toString();\n' + + '}\n\n' + const longToNumberHelper = + 'function longToNumber(value, unsigned) {\n' + + '\tif (typeof value === "number") {\n' + + '\t\treturn value;\n' + + '\t}\n' + + '\tif (typeof value === "string") {\n' + + '\t\tconst numeric = Number(value);\n' + + '\t\treturn numeric;\n' + + '\t}\n' + + '\tif (!$util.Long) {\n' + + '\t\treturn Number(value);\n' + + '\t}\n' + + '\tconst normalized = $util.Long.fromValue(value);\n' + + '\tconst prepared = unsigned && normalized && typeof normalized.toUnsigned === "function"\n' + + '\t\t? normalized.toUnsigned()\n' + + '\t\t: typeof normalized.toSigned === "function"\n' + + '\t\t\t? normalized.toSigned()\n' + + '\t\t\t: normalized;\n' + + '\treturn prepared.toNumber();\n' + + '}\n\n' - // Write back - writeFileSync(filePath, content, 'utf8'); + if (!content.includes('function longToString(')) { + const markerIndex = content.indexOf(marker) + if (markerIndex === -1) { + throw new Error('Unable to inject Long helpers: marker not found in WAProto index output') + } - console.log(`✅ Fixed imports in ${filePath}`); + content = content.replace(marker, `${marker}${longToStringHelper}${longToNumberHelper}`) + } else { + const longToStringRegex = /function longToString\(value, unsigned\) {\n[\s\S]*?\n}\n\n/ + const longToNumberRegex = /function longToNumber\(value, unsigned\) {\n[\s\S]*?\n}\n\n/ + + if (!longToStringRegex.test(content) || !longToNumberRegex.test(content)) { + throw new Error('Unable to update Long helpers: existing definitions not found') + } + + content = content.replace(longToStringRegex, longToStringHelper) + content = content.replace(longToNumberRegex, longToNumberHelper) + } + + const longPattern = /([ \t]+d\.(\w+) = )o\.longs === String \? \$util\.Long\.prototype\.toString\.call\(m\.\2\) : o\.longs === Number \? new \$util\.LongBits\(m\.\2\.low >>> 0, m\.\2\.high >>> 0\)\.toNumber\((true)?\) : m\.\2;/g + content = content.replace(longPattern, (_match, prefix, field, unsignedFlag) => { + const unsignedArg = unsignedFlag ? ', true' : '' + return `${prefix}o.longs === String ? longToString(m.${field}${unsignedArg}) : o.longs === Number ? longToNumber(m.${field}${unsignedArg}) : m.${field};` + }) + + writeFileSync(filePath, content, 'utf8') + console.log(`✅ Fixed imports in ${filePath}`) } catch (error) { - console.error(`❌ Error fixing imports: ${error.message}`); - exit(1); + console.error(`❌ Error fixing imports: ${error.message}`) + exit(1) } diff --git a/WAProto/index.js b/WAProto/index.js index 75dae613..7ccf7180 100644 --- a/WAProto/index.js +++ b/WAProto/index.js @@ -5,6 +5,43 @@ const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf. const $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); +function longToString(value, unsigned) { + if (typeof value === "string") { + return value; + } + if (typeof value === "number") { + return String(value); + } + if (!$util.Long) { + return String(value); + } + const normalized = $util.Long.fromValue(value); + const prepared = unsigned && normalized && typeof normalized.toUnsigned === "function" + ? normalized.toUnsigned() + : normalized; + return prepared.toString(); +} + +function longToNumber(value, unsigned) { + if (typeof value === "number") { + return value; + } + if (typeof value === "string") { + const numeric = Number(value); + return numeric; + } + if (!$util.Long) { + return Number(value); + } + const normalized = $util.Long.fromValue(value); + const prepared = unsigned && normalized && typeof normalized.toUnsigned === "function" + ? normalized.toUnsigned() + : typeof normalized.toSigned === "function" + ? normalized.toSigned() + : normalized; + return prepared.toNumber(); +} + export const proto = $root.proto = (() => { const proto = {}; @@ -181,7 +218,7 @@ export const proto = $root.proto = (() => { if (typeof m.timestamp === "number") d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp; else - d.timestamp = o.longs === String ? $util.Long.prototype.toString.call(m.timestamp) : o.longs === Number ? new $util.LongBits(m.timestamp.low >>> 0, m.timestamp.high >>> 0).toNumber(true) : m.timestamp; + d.timestamp = o.longs === String ? longToString(m.timestamp, true) : o.longs === Number ? longToNumber(m.timestamp, true) : m.timestamp; if (o.oneofs) d._timestamp = "timestamp"; } @@ -397,7 +434,7 @@ export const proto = $root.proto = (() => { if (typeof m.timestamp === "number") d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp; else - d.timestamp = o.longs === String ? $util.Long.prototype.toString.call(m.timestamp) : o.longs === Number ? new $util.LongBits(m.timestamp.low >>> 0, m.timestamp.high >>> 0).toNumber(true) : m.timestamp; + d.timestamp = o.longs === String ? longToString(m.timestamp, true) : o.longs === Number ? longToNumber(m.timestamp, true) : m.timestamp; if (o.oneofs) d._timestamp = "timestamp"; } @@ -1010,7 +1047,7 @@ export const proto = $root.proto = (() => { if (typeof m.lastFetchTime === "number") d.lastFetchTime = o.longs === String ? String(m.lastFetchTime) : m.lastFetchTime; else - d.lastFetchTime = o.longs === String ? $util.Long.prototype.toString.call(m.lastFetchTime) : o.longs === Number ? new $util.LongBits(m.lastFetchTime.low >>> 0, m.lastFetchTime.high >>> 0).toNumber() : m.lastFetchTime; + d.lastFetchTime = o.longs === String ? longToString(m.lastFetchTime) : o.longs === Number ? longToNumber(m.lastFetchTime) : m.lastFetchTime; if (o.oneofs) d._lastFetchTime = "lastFetchTime"; } @@ -1410,7 +1447,7 @@ export const proto = $root.proto = (() => { if (typeof m.timestamp === "number") d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp; else - d.timestamp = o.longs === String ? $util.Long.prototype.toString.call(m.timestamp) : o.longs === Number ? new $util.LongBits(m.timestamp.low >>> 0, m.timestamp.high >>> 0).toNumber() : m.timestamp; + d.timestamp = o.longs === String ? longToString(m.timestamp) : o.longs === Number ? longToNumber(m.timestamp) : m.timestamp; if (o.oneofs) d._timestamp = "timestamp"; } @@ -1531,7 +1568,7 @@ export const proto = $root.proto = (() => { if (typeof m.responseTimestampMs === "number") d.responseTimestampMs = o.longs === String ? String(m.responseTimestampMs) : m.responseTimestampMs; else - d.responseTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.responseTimestampMs) : o.longs === Number ? new $util.LongBits(m.responseTimestampMs.low >>> 0, m.responseTimestampMs.high >>> 0).toNumber() : m.responseTimestampMs; + d.responseTimestampMs = o.longs === String ? longToString(m.responseTimestampMs) : o.longs === Number ? longToNumber(m.responseTimestampMs) : m.responseTimestampMs; if (o.oneofs) d._responseTimestampMs = "responseTimestampMs"; } @@ -2346,7 +2383,7 @@ export const proto = $root.proto = (() => { if (typeof m.version === "number") d.version = o.longs === String ? String(m.version) : m.version; else - d.version = o.longs === String ? $util.Long.prototype.toString.call(m.version) : o.longs === Number ? new $util.LongBits(m.version.low >>> 0, m.version.high >>> 0).toNumber(true) : m.version; + d.version = o.longs === String ? longToString(m.version, true) : o.longs === Number ? longToNumber(m.version, true) : m.version; if (o.oneofs) d._version = "version"; } @@ -5433,7 +5470,7 @@ export const proto = $root.proto = (() => { if (typeof m.whatsappBizAcctFbid === "number") d.whatsappBizAcctFbid = o.longs === String ? String(m.whatsappBizAcctFbid) : m.whatsappBizAcctFbid; else - d.whatsappBizAcctFbid = o.longs === String ? $util.Long.prototype.toString.call(m.whatsappBizAcctFbid) : o.longs === Number ? new $util.LongBits(m.whatsappBizAcctFbid.low >>> 0, m.whatsappBizAcctFbid.high >>> 0).toNumber(true) : m.whatsappBizAcctFbid; + d.whatsappBizAcctFbid = o.longs === String ? longToString(m.whatsappBizAcctFbid, true) : o.longs === Number ? longToNumber(m.whatsappBizAcctFbid, true) : m.whatsappBizAcctFbid; if (o.oneofs) d._whatsappBizAcctFbid = "whatsappBizAcctFbid"; } @@ -5446,7 +5483,7 @@ export const proto = $root.proto = (() => { if (typeof m.issueTime === "number") d.issueTime = o.longs === String ? String(m.issueTime) : m.issueTime; else - d.issueTime = o.longs === String ? $util.Long.prototype.toString.call(m.issueTime) : o.longs === Number ? new $util.LongBits(m.issueTime.low >>> 0, m.issueTime.high >>> 0).toNumber(true) : m.issueTime; + d.issueTime = o.longs === String ? longToString(m.issueTime, true) : o.longs === Number ? longToNumber(m.issueTime, true) : m.issueTime; if (o.oneofs) d._issueTime = "issueTime"; } @@ -5875,7 +5912,7 @@ export const proto = $root.proto = (() => { if (typeof m.privacyModeTs === "number") d.privacyModeTs = o.longs === String ? String(m.privacyModeTs) : m.privacyModeTs; else - d.privacyModeTs = o.longs === String ? $util.Long.prototype.toString.call(m.privacyModeTs) : o.longs === Number ? new $util.LongBits(m.privacyModeTs.low >>> 0, m.privacyModeTs.high >>> 0).toNumber(true) : m.privacyModeTs; + d.privacyModeTs = o.longs === String ? longToString(m.privacyModeTs, true) : o.longs === Number ? longToNumber(m.privacyModeTs, true) : m.privacyModeTs; if (o.oneofs) d._privacyModeTs = "privacyModeTs"; } @@ -5883,7 +5920,7 @@ export const proto = $root.proto = (() => { if (typeof m.featureControls === "number") d.featureControls = o.longs === String ? String(m.featureControls) : m.featureControls; else - d.featureControls = o.longs === String ? $util.Long.prototype.toString.call(m.featureControls) : o.longs === Number ? new $util.LongBits(m.featureControls.low >>> 0, m.featureControls.high >>> 0).toNumber(true) : m.featureControls; + d.featureControls = o.longs === String ? longToString(m.featureControls, true) : o.longs === Number ? longToNumber(m.featureControls, true) : m.featureControls; if (o.oneofs) d._featureControls = "featureControls"; } @@ -6887,7 +6924,7 @@ export const proto = $root.proto = (() => { if (typeof m.kindNegative === "number") d.kindNegative = o.longs === String ? String(m.kindNegative) : m.kindNegative; else - d.kindNegative = o.longs === String ? $util.Long.prototype.toString.call(m.kindNegative) : o.longs === Number ? new $util.LongBits(m.kindNegative.low >>> 0, m.kindNegative.high >>> 0).toNumber(true) : m.kindNegative; + d.kindNegative = o.longs === String ? longToString(m.kindNegative, true) : o.longs === Number ? longToNumber(m.kindNegative, true) : m.kindNegative; if (o.oneofs) d._kindNegative = "kindNegative"; } @@ -6895,7 +6932,7 @@ export const proto = $root.proto = (() => { if (typeof m.kindPositive === "number") d.kindPositive = o.longs === String ? String(m.kindPositive) : m.kindPositive; else - d.kindPositive = o.longs === String ? $util.Long.prototype.toString.call(m.kindPositive) : o.longs === Number ? new $util.LongBits(m.kindPositive.low >>> 0, m.kindPositive.high >>> 0).toNumber(true) : m.kindPositive; + d.kindPositive = o.longs === String ? longToString(m.kindPositive, true) : o.longs === Number ? longToNumber(m.kindPositive, true) : m.kindPositive; if (o.oneofs) d._kindPositive = "kindPositive"; } @@ -8662,7 +8699,7 @@ export const proto = $root.proto = (() => { if (typeof m.mediaKeyTimestamp === "number") d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; else - d.mediaKeyTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.mediaKeyTimestamp) : o.longs === Number ? new $util.LongBits(m.mediaKeyTimestamp.low >>> 0, m.mediaKeyTimestamp.high >>> 0).toNumber() : m.mediaKeyTimestamp; + d.mediaKeyTimestamp = o.longs === String ? longToString(m.mediaKeyTimestamp) : o.longs === Number ? longToNumber(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; if (o.oneofs) d._mediaKeyTimestamp = "mediaKeyTimestamp"; } @@ -12870,7 +12907,7 @@ export const proto = $root.proto = (() => { if (typeof m.expirationTimestamp === "number") d.expirationTimestamp = o.longs === String ? String(m.expirationTimestamp) : m.expirationTimestamp; else - d.expirationTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.expirationTimestamp) : o.longs === Number ? new $util.LongBits(m.expirationTimestamp.low >>> 0, m.expirationTimestamp.high >>> 0).toNumber(true) : m.expirationTimestamp; + d.expirationTimestamp = o.longs === String ? longToString(m.expirationTimestamp, true) : o.longs === Number ? longToNumber(m.expirationTimestamp, true) : m.expirationTimestamp; if (o.oneofs) d._expirationTimestamp = "expirationTimestamp"; } @@ -13105,7 +13142,7 @@ export const proto = $root.proto = (() => { if (typeof m.nextTriggerTimestamp === "number") d.nextTriggerTimestamp = o.longs === String ? String(m.nextTriggerTimestamp) : m.nextTriggerTimestamp; else - d.nextTriggerTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.nextTriggerTimestamp) : o.longs === Number ? new $util.LongBits(m.nextTriggerTimestamp.low >>> 0, m.nextTriggerTimestamp.high >>> 0).toNumber(true) : m.nextTriggerTimestamp; + d.nextTriggerTimestamp = o.longs === String ? longToString(m.nextTriggerTimestamp, true) : o.longs === Number ? longToNumber(m.nextTriggerTimestamp, true) : m.nextTriggerTimestamp; if (o.oneofs) d._nextTriggerTimestamp = "nextTriggerTimestamp"; } @@ -15087,7 +15124,7 @@ export const proto = $root.proto = (() => { if (typeof m.duration === "number") d.duration = o.longs === String ? String(m.duration) : m.duration; else - d.duration = o.longs === String ? $util.Long.prototype.toString.call(m.duration) : o.longs === Number ? new $util.LongBits(m.duration.low >>> 0, m.duration.high >>> 0).toNumber() : m.duration; + d.duration = o.longs === String ? longToString(m.duration) : o.longs === Number ? longToNumber(m.duration) : m.duration; if (o.oneofs) d._duration = "duration"; } @@ -15095,7 +15132,7 @@ export const proto = $root.proto = (() => { if (typeof m.startTime === "number") d.startTime = o.longs === String ? String(m.startTime) : m.startTime; else - d.startTime = o.longs === String ? $util.Long.prototype.toString.call(m.startTime) : o.longs === Number ? new $util.LongBits(m.startTime.low >>> 0, m.startTime.high >>> 0).toNumber() : m.startTime; + d.startTime = o.longs === String ? longToString(m.startTime) : o.longs === Number ? longToNumber(m.startTime) : m.startTime; if (o.oneofs) d._startTime = "startTime"; } @@ -15746,7 +15783,7 @@ export const proto = $root.proto = (() => { if (typeof m.notBefore === "number") d.notBefore = o.longs === String ? String(m.notBefore) : m.notBefore; else - d.notBefore = o.longs === String ? $util.Long.prototype.toString.call(m.notBefore) : o.longs === Number ? new $util.LongBits(m.notBefore.low >>> 0, m.notBefore.high >>> 0).toNumber(true) : m.notBefore; + d.notBefore = o.longs === String ? longToString(m.notBefore, true) : o.longs === Number ? longToNumber(m.notBefore, true) : m.notBefore; if (o.oneofs) d._notBefore = "notBefore"; } @@ -15754,7 +15791,7 @@ export const proto = $root.proto = (() => { if (typeof m.notAfter === "number") d.notAfter = o.longs === String ? String(m.notAfter) : m.notAfter; else - d.notAfter = o.longs === String ? $util.Long.prototype.toString.call(m.notAfter) : o.longs === Number ? new $util.LongBits(m.notAfter.low >>> 0, m.notAfter.high >>> 0).toNumber(true) : m.notAfter; + d.notAfter = o.longs === String ? longToString(m.notAfter, true) : o.longs === Number ? longToNumber(m.notAfter, true) : m.notAfter; if (o.oneofs) d._notAfter = "notAfter"; } @@ -16144,7 +16181,7 @@ export const proto = $root.proto = (() => { if (typeof m.timestamp === "number") d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp; else - d.timestamp = o.longs === String ? $util.Long.prototype.toString.call(m.timestamp) : o.longs === Number ? new $util.LongBits(m.timestamp.low >>> 0, m.timestamp.high >>> 0).toNumber() : m.timestamp; + d.timestamp = o.longs === String ? longToString(m.timestamp) : o.longs === Number ? longToNumber(m.timestamp) : m.timestamp; if (o.oneofs) d._timestamp = "timestamp"; } @@ -17733,7 +17770,7 @@ export const proto = $root.proto = (() => { if (typeof m.username === "number") d.username = o.longs === String ? String(m.username) : m.username; else - d.username = o.longs === String ? $util.Long.prototype.toString.call(m.username) : o.longs === Number ? new $util.LongBits(m.username.low >>> 0, m.username.high >>> 0).toNumber(true) : m.username; + d.username = o.longs === String ? longToString(m.username, true) : o.longs === Number ? longToNumber(m.username, true) : m.username; if (o.oneofs) d._username = "username"; } @@ -17837,7 +17874,7 @@ export const proto = $root.proto = (() => { if (typeof m.fbAppId === "number") d.fbAppId = o.longs === String ? String(m.fbAppId) : m.fbAppId; else - d.fbAppId = o.longs === String ? $util.Long.prototype.toString.call(m.fbAppId) : o.longs === Number ? new $util.LongBits(m.fbAppId.low >>> 0, m.fbAppId.high >>> 0).toNumber(true) : m.fbAppId; + d.fbAppId = o.longs === String ? longToString(m.fbAppId, true) : o.longs === Number ? longToNumber(m.fbAppId, true) : m.fbAppId; if (o.oneofs) d._fbAppId = "fbAppId"; } @@ -18487,7 +18524,7 @@ export const proto = $root.proto = (() => { if (typeof m.accountId === "number") d.accountId = o.longs === String ? String(m.accountId) : m.accountId; else - d.accountId = o.longs === String ? $util.Long.prototype.toString.call(m.accountId) : o.longs === Number ? new $util.LongBits(m.accountId.low >>> 0, m.accountId.high >>> 0).toNumber(true) : m.accountId; + d.accountId = o.longs === String ? longToString(m.accountId, true) : o.longs === Number ? longToNumber(m.accountId, true) : m.accountId; if (o.oneofs) d._accountId = "accountId"; } @@ -21672,7 +21709,7 @@ export const proto = $root.proto = (() => { if (typeof m.ephemeralSettingTimestamp === "number") d.ephemeralSettingTimestamp = o.longs === String ? String(m.ephemeralSettingTimestamp) : m.ephemeralSettingTimestamp; else - d.ephemeralSettingTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.ephemeralSettingTimestamp) : o.longs === Number ? new $util.LongBits(m.ephemeralSettingTimestamp.low >>> 0, m.ephemeralSettingTimestamp.high >>> 0).toNumber() : m.ephemeralSettingTimestamp; + d.ephemeralSettingTimestamp = o.longs === String ? longToString(m.ephemeralSettingTimestamp) : o.longs === Number ? longToNumber(m.ephemeralSettingTimestamp) : m.ephemeralSettingTimestamp; if (o.oneofs) d._ephemeralSettingTimestamp = "ephemeralSettingTimestamp"; } @@ -22482,7 +22519,7 @@ export const proto = $root.proto = (() => { if (typeof m.intData === "number") d.intData = o.longs === String ? String(m.intData) : m.intData; else - d.intData = o.longs === String ? $util.Long.prototype.toString.call(m.intData) : o.longs === Number ? new $util.LongBits(m.intData.low >>> 0, m.intData.high >>> 0).toNumber() : m.intData; + d.intData = o.longs === String ? longToString(m.intData) : o.longs === Number ? longToNumber(m.intData) : m.intData; if (o.oneofs) d._intData = "intData"; } @@ -25062,7 +25099,7 @@ export const proto = $root.proto = (() => { if (typeof m.lastMsgTimestamp === "number") d.lastMsgTimestamp = o.longs === String ? String(m.lastMsgTimestamp) : m.lastMsgTimestamp; else - d.lastMsgTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.lastMsgTimestamp) : o.longs === Number ? new $util.LongBits(m.lastMsgTimestamp.low >>> 0, m.lastMsgTimestamp.high >>> 0).toNumber(true) : m.lastMsgTimestamp; + d.lastMsgTimestamp = o.longs === String ? longToString(m.lastMsgTimestamp, true) : o.longs === Number ? longToNumber(m.lastMsgTimestamp, true) : m.lastMsgTimestamp; if (o.oneofs) d._lastMsgTimestamp = "lastMsgTimestamp"; } @@ -25090,7 +25127,7 @@ export const proto = $root.proto = (() => { if (typeof m.ephemeralSettingTimestamp === "number") d.ephemeralSettingTimestamp = o.longs === String ? String(m.ephemeralSettingTimestamp) : m.ephemeralSettingTimestamp; else - d.ephemeralSettingTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.ephemeralSettingTimestamp) : o.longs === Number ? new $util.LongBits(m.ephemeralSettingTimestamp.low >>> 0, m.ephemeralSettingTimestamp.high >>> 0).toNumber() : m.ephemeralSettingTimestamp; + d.ephemeralSettingTimestamp = o.longs === String ? longToString(m.ephemeralSettingTimestamp) : o.longs === Number ? longToNumber(m.ephemeralSettingTimestamp) : m.ephemeralSettingTimestamp; if (o.oneofs) d._ephemeralSettingTimestamp = "ephemeralSettingTimestamp"; } @@ -25103,7 +25140,7 @@ export const proto = $root.proto = (() => { if (typeof m.conversationTimestamp === "number") d.conversationTimestamp = o.longs === String ? String(m.conversationTimestamp) : m.conversationTimestamp; else - d.conversationTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.conversationTimestamp) : o.longs === Number ? new $util.LongBits(m.conversationTimestamp.low >>> 0, m.conversationTimestamp.high >>> 0).toNumber(true) : m.conversationTimestamp; + d.conversationTimestamp = o.longs === String ? longToString(m.conversationTimestamp, true) : o.longs === Number ? longToNumber(m.conversationTimestamp, true) : m.conversationTimestamp; if (o.oneofs) d._conversationTimestamp = "conversationTimestamp"; } @@ -25157,7 +25194,7 @@ export const proto = $root.proto = (() => { if (typeof m.tcTokenTimestamp === "number") d.tcTokenTimestamp = o.longs === String ? String(m.tcTokenTimestamp) : m.tcTokenTimestamp; else - d.tcTokenTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.tcTokenTimestamp) : o.longs === Number ? new $util.LongBits(m.tcTokenTimestamp.low >>> 0, m.tcTokenTimestamp.high >>> 0).toNumber(true) : m.tcTokenTimestamp; + d.tcTokenTimestamp = o.longs === String ? longToString(m.tcTokenTimestamp, true) : o.longs === Number ? longToNumber(m.tcTokenTimestamp, true) : m.tcTokenTimestamp; if (o.oneofs) d._tcTokenTimestamp = "tcTokenTimestamp"; } @@ -25175,7 +25212,7 @@ export const proto = $root.proto = (() => { if (typeof m.muteEndTime === "number") d.muteEndTime = o.longs === String ? String(m.muteEndTime) : m.muteEndTime; else - d.muteEndTime = o.longs === String ? $util.Long.prototype.toString.call(m.muteEndTime) : o.longs === Number ? new $util.LongBits(m.muteEndTime.low >>> 0, m.muteEndTime.high >>> 0).toNumber(true) : m.muteEndTime; + d.muteEndTime = o.longs === String ? longToString(m.muteEndTime, true) : o.longs === Number ? longToNumber(m.muteEndTime, true) : m.muteEndTime; if (o.oneofs) d._muteEndTime = "muteEndTime"; } @@ -25193,7 +25230,7 @@ export const proto = $root.proto = (() => { if (typeof m.tcTokenSenderTimestamp === "number") d.tcTokenSenderTimestamp = o.longs === String ? String(m.tcTokenSenderTimestamp) : m.tcTokenSenderTimestamp; else - d.tcTokenSenderTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.tcTokenSenderTimestamp) : o.longs === Number ? new $util.LongBits(m.tcTokenSenderTimestamp.low >>> 0, m.tcTokenSenderTimestamp.high >>> 0).toNumber(true) : m.tcTokenSenderTimestamp; + d.tcTokenSenderTimestamp = o.longs === String ? longToString(m.tcTokenSenderTimestamp, true) : o.longs === Number ? longToNumber(m.tcTokenSenderTimestamp, true) : m.tcTokenSenderTimestamp; if (o.oneofs) d._tcTokenSenderTimestamp = "tcTokenSenderTimestamp"; } @@ -25211,7 +25248,7 @@ export const proto = $root.proto = (() => { if (typeof m.createdAt === "number") d.createdAt = o.longs === String ? String(m.createdAt) : m.createdAt; else - d.createdAt = o.longs === String ? $util.Long.prototype.toString.call(m.createdAt) : o.longs === Number ? new $util.LongBits(m.createdAt.low >>> 0, m.createdAt.high >>> 0).toNumber(true) : m.createdAt; + d.createdAt = o.longs === String ? longToString(m.createdAt, true) : o.longs === Number ? longToNumber(m.createdAt, true) : m.createdAt; if (o.oneofs) d._createdAt = "createdAt"; } @@ -25314,7 +25351,7 @@ export const proto = $root.proto = (() => { if (typeof m.limitSharingSettingTimestamp === "number") d.limitSharingSettingTimestamp = o.longs === String ? String(m.limitSharingSettingTimestamp) : m.limitSharingSettingTimestamp; else - d.limitSharingSettingTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.limitSharingSettingTimestamp) : o.longs === Number ? new $util.LongBits(m.limitSharingSettingTimestamp.low >>> 0, m.limitSharingSettingTimestamp.high >>> 0).toNumber() : m.limitSharingSettingTimestamp; + d.limitSharingSettingTimestamp = o.longs === String ? longToString(m.limitSharingSettingTimestamp) : o.longs === Number ? longToNumber(m.limitSharingSettingTimestamp) : m.limitSharingSettingTimestamp; if (o.oneofs) d._limitSharingSettingTimestamp = "limitSharingSettingTimestamp"; } @@ -25740,7 +25777,7 @@ export const proto = $root.proto = (() => { if (typeof m.chatDbMigrationTimestamp === "number") d.chatDbMigrationTimestamp = o.longs === String ? String(m.chatDbMigrationTimestamp) : m.chatDbMigrationTimestamp; else - d.chatDbMigrationTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.chatDbMigrationTimestamp) : o.longs === Number ? new $util.LongBits(m.chatDbMigrationTimestamp.low >>> 0, m.chatDbMigrationTimestamp.high >>> 0).toNumber(true) : m.chatDbMigrationTimestamp; + d.chatDbMigrationTimestamp = o.longs === String ? longToString(m.chatDbMigrationTimestamp, true) : o.longs === Number ? longToNumber(m.chatDbMigrationTimestamp, true) : m.chatDbMigrationTimestamp; if (o.oneofs) d._chatDbMigrationTimestamp = "chatDbMigrationTimestamp"; } @@ -26231,7 +26268,7 @@ export const proto = $root.proto = (() => { if (typeof m.senderTimestamp === "number") d.senderTimestamp = o.longs === String ? String(m.senderTimestamp) : m.senderTimestamp; else - d.senderTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.senderTimestamp) : o.longs === Number ? new $util.LongBits(m.senderTimestamp.low >>> 0, m.senderTimestamp.high >>> 0).toNumber(true) : m.senderTimestamp; + d.senderTimestamp = o.longs === String ? longToString(m.senderTimestamp, true) : o.longs === Number ? longToNumber(m.senderTimestamp, true) : m.senderTimestamp; if (o.oneofs) d._senderTimestamp = "senderTimestamp"; } @@ -26260,7 +26297,7 @@ export const proto = $root.proto = (() => { if (typeof m.recipientTimestamp === "number") d.recipientTimestamp = o.longs === String ? String(m.recipientTimestamp) : m.recipientTimestamp; else - d.recipientTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.recipientTimestamp) : o.longs === Number ? new $util.LongBits(m.recipientTimestamp.low >>> 0, m.recipientTimestamp.high >>> 0).toNumber(true) : m.recipientTimestamp; + d.recipientTimestamp = o.longs === String ? longToString(m.recipientTimestamp, true) : o.longs === Number ? longToNumber(m.recipientTimestamp, true) : m.recipientTimestamp; if (o.oneofs) d._recipientTimestamp = "recipientTimestamp"; } @@ -28040,7 +28077,7 @@ export const proto = $root.proto = (() => { if (typeof m.musicSongStartTimeInMs === "number") d.musicSongStartTimeInMs = o.longs === String ? String(m.musicSongStartTimeInMs) : m.musicSongStartTimeInMs; else - d.musicSongStartTimeInMs = o.longs === String ? $util.Long.prototype.toString.call(m.musicSongStartTimeInMs) : o.longs === Number ? new $util.LongBits(m.musicSongStartTimeInMs.low >>> 0, m.musicSongStartTimeInMs.high >>> 0).toNumber() : m.musicSongStartTimeInMs; + d.musicSongStartTimeInMs = o.longs === String ? longToString(m.musicSongStartTimeInMs) : o.longs === Number ? longToNumber(m.musicSongStartTimeInMs) : m.musicSongStartTimeInMs; if (o.oneofs) d._musicSongStartTimeInMs = "musicSongStartTimeInMs"; } @@ -28048,7 +28085,7 @@ export const proto = $root.proto = (() => { if (typeof m.derivedContentStartTimeInMs === "number") d.derivedContentStartTimeInMs = o.longs === String ? String(m.derivedContentStartTimeInMs) : m.derivedContentStartTimeInMs; else - d.derivedContentStartTimeInMs = o.longs === String ? $util.Long.prototype.toString.call(m.derivedContentStartTimeInMs) : o.longs === Number ? new $util.LongBits(m.derivedContentStartTimeInMs.low >>> 0, m.derivedContentStartTimeInMs.high >>> 0).toNumber() : m.derivedContentStartTimeInMs; + d.derivedContentStartTimeInMs = o.longs === String ? longToString(m.derivedContentStartTimeInMs) : o.longs === Number ? longToNumber(m.derivedContentStartTimeInMs) : m.derivedContentStartTimeInMs; if (o.oneofs) d._derivedContentStartTimeInMs = "derivedContentStartTimeInMs"; } @@ -28056,7 +28093,7 @@ export const proto = $root.proto = (() => { if (typeof m.overlapDurationInMs === "number") d.overlapDurationInMs = o.longs === String ? String(m.overlapDurationInMs) : m.overlapDurationInMs; else - d.overlapDurationInMs = o.longs === String ? $util.Long.prototype.toString.call(m.overlapDurationInMs) : o.longs === Number ? new $util.LongBits(m.overlapDurationInMs.low >>> 0, m.overlapDurationInMs.high >>> 0).toNumber() : m.overlapDurationInMs; + d.overlapDurationInMs = o.longs === String ? longToString(m.overlapDurationInMs) : o.longs === Number ? longToNumber(m.overlapDurationInMs) : m.overlapDurationInMs; if (o.oneofs) d._overlapDurationInMs = "overlapDurationInMs"; } @@ -28290,7 +28327,7 @@ export const proto = $root.proto = (() => { if (typeof m.timestamp === "number") d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp; else - d.timestamp = o.longs === String ? $util.Long.prototype.toString.call(m.timestamp) : o.longs === Number ? new $util.LongBits(m.timestamp.low >>> 0, m.timestamp.high >>> 0).toNumber() : m.timestamp; + d.timestamp = o.longs === String ? longToString(m.timestamp) : o.longs === Number ? longToNumber(m.timestamp) : m.timestamp; if (o.oneofs) d._timestamp = "timestamp"; } @@ -28533,7 +28570,7 @@ export const proto = $root.proto = (() => { if (typeof m.timestampMs === "number") d.timestampMs = o.longs === String ? String(m.timestampMs) : m.timestampMs; else - d.timestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.timestampMs) : o.longs === Number ? new $util.LongBits(m.timestampMs.low >>> 0, m.timestampMs.high >>> 0).toNumber() : m.timestampMs; + d.timestampMs = o.longs === String ? longToString(m.timestampMs) : o.longs === Number ? longToNumber(m.timestampMs) : m.timestampMs; if (o.oneofs) d._timestampMs = "timestampMs"; } @@ -28657,7 +28694,7 @@ export const proto = $root.proto = (() => { if (typeof m.code === "number") d.code = o.longs === String ? String(m.code) : m.code; else - d.code = o.longs === String ? $util.Long.prototype.toString.call(m.code) : o.longs === Number ? new $util.LongBits(m.code.low >>> 0, m.code.high >>> 0).toNumber(true) : m.code; + d.code = o.longs === String ? longToString(m.code, true) : o.longs === Number ? longToNumber(m.code, true) : m.code; if (o.oneofs) d._code = "code"; } @@ -28864,7 +28901,7 @@ export const proto = $root.proto = (() => { if (typeof m.fileSizeBytes === "number") d.fileSizeBytes = o.longs === String ? String(m.fileSizeBytes) : m.fileSizeBytes; else - d.fileSizeBytes = o.longs === String ? $util.Long.prototype.toString.call(m.fileSizeBytes) : o.longs === Number ? new $util.LongBits(m.fileSizeBytes.low >>> 0, m.fileSizeBytes.high >>> 0).toNumber(true) : m.fileSizeBytes; + d.fileSizeBytes = o.longs === String ? longToString(m.fileSizeBytes, true) : o.longs === Number ? longToNumber(m.fileSizeBytes, true) : m.fileSizeBytes; if (o.oneofs) d._fileSizeBytes = "fileSizeBytes"; } @@ -29695,7 +29732,7 @@ export const proto = $root.proto = (() => { if (typeof m.disappearingModeTimestamp === "number") d.disappearingModeTimestamp = o.longs === String ? String(m.disappearingModeTimestamp) : m.disappearingModeTimestamp; else - d.disappearingModeTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.disappearingModeTimestamp) : o.longs === Number ? new $util.LongBits(m.disappearingModeTimestamp.low >>> 0, m.disappearingModeTimestamp.high >>> 0).toNumber() : m.disappearingModeTimestamp; + d.disappearingModeTimestamp = o.longs === String ? longToString(m.disappearingModeTimestamp) : o.longs === Number ? longToNumber(m.disappearingModeTimestamp) : m.disappearingModeTimestamp; if (o.oneofs) d._disappearingModeTimestamp = "disappearingModeTimestamp"; } @@ -29748,7 +29785,7 @@ export const proto = $root.proto = (() => { if (typeof m.chatDbLidMigrationTimestamp === "number") d.chatDbLidMigrationTimestamp = o.longs === String ? String(m.chatDbLidMigrationTimestamp) : m.chatDbLidMigrationTimestamp; else - d.chatDbLidMigrationTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.chatDbLidMigrationTimestamp) : o.longs === Number ? new $util.LongBits(m.chatDbLidMigrationTimestamp.low >>> 0, m.chatDbLidMigrationTimestamp.high >>> 0).toNumber() : m.chatDbLidMigrationTimestamp; + d.chatDbLidMigrationTimestamp = o.longs === String ? longToString(m.chatDbLidMigrationTimestamp) : o.longs === Number ? longToNumber(m.chatDbLidMigrationTimestamp) : m.chatDbLidMigrationTimestamp; if (o.oneofs) d._chatDbLidMigrationTimestamp = "chatDbLidMigrationTimestamp"; } @@ -31567,7 +31604,7 @@ export const proto = $root.proto = (() => { if (typeof m.msgOrderId === "number") d.msgOrderId = o.longs === String ? String(m.msgOrderId) : m.msgOrderId; else - d.msgOrderId = o.longs === String ? $util.Long.prototype.toString.call(m.msgOrderId) : o.longs === Number ? new $util.LongBits(m.msgOrderId.low >>> 0, m.msgOrderId.high >>> 0).toNumber(true) : m.msgOrderId; + d.msgOrderId = o.longs === String ? longToString(m.msgOrderId, true) : o.longs === Number ? longToNumber(m.msgOrderId, true) : m.msgOrderId; if (o.oneofs) d._msgOrderId = "msgOrderId"; } @@ -33604,7 +33641,7 @@ export const proto = $root.proto = (() => { if (typeof m.serverTimestamp === "number") d.serverTimestamp = o.longs === String ? String(m.serverTimestamp) : m.serverTimestamp; else - d.serverTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.serverTimestamp) : o.longs === Number ? new $util.LongBits(m.serverTimestamp.low >>> 0, m.serverTimestamp.high >>> 0).toNumber() : m.serverTimestamp; + d.serverTimestamp = o.longs === String ? longToString(m.serverTimestamp) : o.longs === Number ? longToNumber(m.serverTimestamp) : m.serverTimestamp; if (o.oneofs) d._serverTimestamp = "serverTimestamp"; } @@ -33622,7 +33659,7 @@ export const proto = $root.proto = (() => { if (typeof m.clientTimestampMs === "number") d.clientTimestampMs = o.longs === String ? String(m.clientTimestampMs) : m.clientTimestampMs; else - d.clientTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.clientTimestampMs) : o.longs === Number ? new $util.LongBits(m.clientTimestampMs.low >>> 0, m.clientTimestampMs.high >>> 0).toNumber() : m.clientTimestampMs; + d.clientTimestampMs = o.longs === String ? longToString(m.clientTimestampMs) : o.longs === Number ? longToNumber(m.clientTimestampMs) : m.clientTimestampMs; if (o.oneofs) d._clientTimestampMs = "clientTimestampMs"; } @@ -33630,7 +33667,7 @@ export const proto = $root.proto = (() => { if (typeof m.serverTimestampMs === "number") d.serverTimestampMs = o.longs === String ? String(m.serverTimestampMs) : m.serverTimestampMs; else - d.serverTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.serverTimestampMs) : o.longs === Number ? new $util.LongBits(m.serverTimestampMs.low >>> 0, m.serverTimestampMs.high >>> 0).toNumber() : m.serverTimestampMs; + d.serverTimestampMs = o.longs === String ? longToString(m.serverTimestampMs) : o.longs === Number ? longToNumber(m.serverTimestampMs) : m.serverTimestampMs; if (o.oneofs) d._serverTimestampMs = "serverTimestampMs"; } @@ -34057,19 +34094,19 @@ export const proto = $root.proto = (() => { if (typeof m.pn === "number") d.pn = o.longs === String ? String(m.pn) : m.pn; else - d.pn = o.longs === String ? $util.Long.prototype.toString.call(m.pn) : o.longs === Number ? new $util.LongBits(m.pn.low >>> 0, m.pn.high >>> 0).toNumber(true) : m.pn; + d.pn = o.longs === String ? longToString(m.pn, true) : o.longs === Number ? longToNumber(m.pn, true) : m.pn; } if (m.assignedLid != null && m.hasOwnProperty("assignedLid")) { if (typeof m.assignedLid === "number") d.assignedLid = o.longs === String ? String(m.assignedLid) : m.assignedLid; else - d.assignedLid = o.longs === String ? $util.Long.prototype.toString.call(m.assignedLid) : o.longs === Number ? new $util.LongBits(m.assignedLid.low >>> 0, m.assignedLid.high >>> 0).toNumber(true) : m.assignedLid; + d.assignedLid = o.longs === String ? longToString(m.assignedLid, true) : o.longs === Number ? longToNumber(m.assignedLid, true) : m.assignedLid; } if (m.latestLid != null && m.hasOwnProperty("latestLid")) { if (typeof m.latestLid === "number") d.latestLid = o.longs === String ? String(m.latestLid) : m.latestLid; else - d.latestLid = o.longs === String ? $util.Long.prototype.toString.call(m.latestLid) : o.longs === Number ? new $util.LongBits(m.latestLid.low >>> 0, m.latestLid.high >>> 0).toNumber(true) : m.latestLid; + d.latestLid = o.longs === String ? longToString(m.latestLid, true) : o.longs === Number ? longToNumber(m.latestLid, true) : m.latestLid; if (o.oneofs) d._latestLid = "latestLid"; } @@ -34289,7 +34326,7 @@ export const proto = $root.proto = (() => { if (typeof m.chatDbMigrationTimestamp === "number") d.chatDbMigrationTimestamp = o.longs === String ? String(m.chatDbMigrationTimestamp) : m.chatDbMigrationTimestamp; else - d.chatDbMigrationTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.chatDbMigrationTimestamp) : o.longs === Number ? new $util.LongBits(m.chatDbMigrationTimestamp.low >>> 0, m.chatDbMigrationTimestamp.high >>> 0).toNumber(true) : m.chatDbMigrationTimestamp; + d.chatDbMigrationTimestamp = o.longs === String ? longToString(m.chatDbMigrationTimestamp, true) : o.longs === Number ? longToNumber(m.chatDbMigrationTimestamp, true) : m.chatDbMigrationTimestamp; if (o.oneofs) d._chatDbMigrationTimestamp = "chatDbMigrationTimestamp"; } @@ -34579,7 +34616,7 @@ export const proto = $root.proto = (() => { if (typeof m.limitSharingSettingTimestamp === "number") d.limitSharingSettingTimestamp = o.longs === String ? String(m.limitSharingSettingTimestamp) : m.limitSharingSettingTimestamp; else - d.limitSharingSettingTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.limitSharingSettingTimestamp) : o.longs === Number ? new $util.LongBits(m.limitSharingSettingTimestamp.low >>> 0, m.limitSharingSettingTimestamp.high >>> 0).toNumber() : m.limitSharingSettingTimestamp; + d.limitSharingSettingTimestamp = o.longs === String ? longToString(m.limitSharingSettingTimestamp) : o.longs === Number ? longToNumber(m.limitSharingSettingTimestamp) : m.limitSharingSettingTimestamp; if (o.oneofs) d._limitSharingSettingTimestamp = "limitSharingSettingTimestamp"; } @@ -35084,7 +35121,7 @@ export const proto = $root.proto = (() => { if (typeof m.fileLength === "number") d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength; else - d.fileLength = o.longs === String ? $util.Long.prototype.toString.call(m.fileLength) : o.longs === Number ? new $util.LongBits(m.fileLength.low >>> 0, m.fileLength.high >>> 0).toNumber(true) : m.fileLength; + d.fileLength = o.longs === String ? longToString(m.fileLength, true) : o.longs === Number ? longToNumber(m.fileLength, true) : m.fileLength; if (o.oneofs) d._fileLength = "fileLength"; } @@ -35395,7 +35432,7 @@ export const proto = $root.proto = (() => { if (typeof m.labelTimestamp === "number") d.labelTimestamp = o.longs === String ? String(m.labelTimestamp) : m.labelTimestamp; else - d.labelTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.labelTimestamp) : o.longs === Number ? new $util.LongBits(m.labelTimestamp.low >>> 0, m.labelTimestamp.high >>> 0).toNumber() : m.labelTimestamp; + d.labelTimestamp = o.longs === String ? longToString(m.labelTimestamp) : o.longs === Number ? longToNumber(m.labelTimestamp) : m.labelTimestamp; if (o.oneofs) d._labelTimestamp = "labelTimestamp"; } @@ -37901,7 +37938,7 @@ export const proto = $root.proto = (() => { if (typeof m.timestamp === "number") d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp; else - d.timestamp = o.longs === String ? $util.Long.prototype.toString.call(m.timestamp) : o.longs === Number ? new $util.LongBits(m.timestamp.low >>> 0, m.timestamp.high >>> 0).toNumber() : m.timestamp; + d.timestamp = o.longs === String ? longToString(m.timestamp) : o.longs === Number ? longToNumber(m.timestamp) : m.timestamp; if (o.oneofs) d._timestamp = "timestamp"; } @@ -38159,7 +38196,7 @@ export const proto = $root.proto = (() => { if (typeof m.timestamp === "number") d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp; else - d.timestamp = o.longs === String ? $util.Long.prototype.toString.call(m.timestamp) : o.longs === Number ? new $util.LongBits(m.timestamp.low >>> 0, m.timestamp.high >>> 0).toNumber() : m.timestamp; + d.timestamp = o.longs === String ? longToString(m.timestamp) : o.longs === Number ? longToNumber(m.timestamp) : m.timestamp; if (o.oneofs) d._timestamp = "timestamp"; } @@ -39005,7 +39042,7 @@ export const proto = $root.proto = (() => { if (typeof m.fileLength === "number") d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength; else - d.fileLength = o.longs === String ? $util.Long.prototype.toString.call(m.fileLength) : o.longs === Number ? new $util.LongBits(m.fileLength.low >>> 0, m.fileLength.high >>> 0).toNumber(true) : m.fileLength; + d.fileLength = o.longs === String ? longToString(m.fileLength, true) : o.longs === Number ? longToNumber(m.fileLength, true) : m.fileLength; if (o.oneofs) d._fileLength = "fileLength"; } @@ -39038,7 +39075,7 @@ export const proto = $root.proto = (() => { if (typeof m.mediaKeyTimestamp === "number") d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; else - d.mediaKeyTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.mediaKeyTimestamp) : o.longs === Number ? new $util.LongBits(m.mediaKeyTimestamp.low >>> 0, m.mediaKeyTimestamp.high >>> 0).toNumber() : m.mediaKeyTimestamp; + d.mediaKeyTimestamp = o.longs === String ? longToString(m.mediaKeyTimestamp) : o.longs === Number ? longToNumber(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; if (o.oneofs) d._mediaKeyTimestamp = "mediaKeyTimestamp"; } @@ -40620,7 +40657,7 @@ export const proto = $root.proto = (() => { if (typeof m.durationSecs === "number") d.durationSecs = o.longs === String ? String(m.durationSecs) : m.durationSecs; else - d.durationSecs = o.longs === String ? $util.Long.prototype.toString.call(m.durationSecs) : o.longs === Number ? new $util.LongBits(m.durationSecs.low >>> 0, m.durationSecs.high >>> 0).toNumber() : m.durationSecs; + d.durationSecs = o.longs === String ? longToString(m.durationSecs) : o.longs === Number ? longToNumber(m.durationSecs) : m.durationSecs; if (o.oneofs) d._durationSecs = "durationSecs"; } @@ -41199,7 +41236,7 @@ export const proto = $root.proto = (() => { if (typeof m.senderNotificationTimestampMs === "number") d.senderNotificationTimestampMs = o.longs === String ? String(m.senderNotificationTimestampMs) : m.senderNotificationTimestampMs; else - d.senderNotificationTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.senderNotificationTimestampMs) : o.longs === Number ? new $util.LongBits(m.senderNotificationTimestampMs.low >>> 0, m.senderNotificationTimestampMs.high >>> 0).toNumber() : m.senderNotificationTimestampMs; + d.senderNotificationTimestampMs = o.longs === String ? longToString(m.senderNotificationTimestampMs) : o.longs === Number ? longToNumber(m.senderNotificationTimestampMs) : m.senderNotificationTimestampMs; if (o.oneofs) d._senderNotificationTimestampMs = "senderNotificationTimestampMs"; } @@ -42451,7 +42488,7 @@ export const proto = $root.proto = (() => { if (typeof m.fileLength === "number") d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength; else - d.fileLength = o.longs === String ? $util.Long.prototype.toString.call(m.fileLength) : o.longs === Number ? new $util.LongBits(m.fileLength.low >>> 0, m.fileLength.high >>> 0).toNumber(true) : m.fileLength; + d.fileLength = o.longs === String ? longToString(m.fileLength, true) : o.longs === Number ? longToNumber(m.fileLength, true) : m.fileLength; if (o.oneofs) d._fileLength = "fileLength"; } @@ -42484,7 +42521,7 @@ export const proto = $root.proto = (() => { if (typeof m.mediaKeyTimestamp === "number") d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; else - d.mediaKeyTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.mediaKeyTimestamp) : o.longs === Number ? new $util.LongBits(m.mediaKeyTimestamp.low >>> 0, m.mediaKeyTimestamp.high >>> 0).toNumber() : m.mediaKeyTimestamp; + d.mediaKeyTimestamp = o.longs === String ? longToString(m.mediaKeyTimestamp) : o.longs === Number ? longToNumber(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; if (o.oneofs) d._mediaKeyTimestamp = "mediaKeyTimestamp"; } @@ -43275,7 +43312,7 @@ export const proto = $root.proto = (() => { if (typeof m.startTime === "number") d.startTime = o.longs === String ? String(m.startTime) : m.startTime; else - d.startTime = o.longs === String ? $util.Long.prototype.toString.call(m.startTime) : o.longs === Number ? new $util.LongBits(m.startTime.low >>> 0, m.startTime.high >>> 0).toNumber() : m.startTime; + d.startTime = o.longs === String ? longToString(m.startTime) : o.longs === Number ? longToNumber(m.startTime) : m.startTime; if (o.oneofs) d._startTime = "startTime"; } @@ -43283,7 +43320,7 @@ export const proto = $root.proto = (() => { if (typeof m.endTime === "number") d.endTime = o.longs === String ? String(m.endTime) : m.endTime; else - d.endTime = o.longs === String ? $util.Long.prototype.toString.call(m.endTime) : o.longs === Number ? new $util.LongBits(m.endTime.low >>> 0, m.endTime.high >>> 0).toNumber() : m.endTime; + d.endTime = o.longs === String ? longToString(m.endTime) : o.longs === Number ? longToNumber(m.endTime) : m.endTime; if (o.oneofs) d._endTime = "endTime"; } @@ -43306,7 +43343,7 @@ export const proto = $root.proto = (() => { if (typeof m.reminderOffsetSec === "number") d.reminderOffsetSec = o.longs === String ? String(m.reminderOffsetSec) : m.reminderOffsetSec; else - d.reminderOffsetSec = o.longs === String ? $util.Long.prototype.toString.call(m.reminderOffsetSec) : o.longs === Number ? new $util.LongBits(m.reminderOffsetSec.low >>> 0, m.reminderOffsetSec.high >>> 0).toNumber() : m.reminderOffsetSec; + d.reminderOffsetSec = o.longs === String ? longToString(m.reminderOffsetSec) : o.longs === Number ? longToNumber(m.reminderOffsetSec) : m.reminderOffsetSec; if (o.oneofs) d._reminderOffsetSec = "reminderOffsetSec"; } @@ -43462,7 +43499,7 @@ export const proto = $root.proto = (() => { if (typeof m.timestampMs === "number") d.timestampMs = o.longs === String ? String(m.timestampMs) : m.timestampMs; else - d.timestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.timestampMs) : o.longs === Number ? new $util.LongBits(m.timestampMs.low >>> 0, m.timestampMs.high >>> 0).toNumber() : m.timestampMs; + d.timestampMs = o.longs === String ? longToString(m.timestampMs) : o.longs === Number ? longToNumber(m.timestampMs) : m.timestampMs; if (o.oneofs) d._timestampMs = "timestampMs"; } @@ -44289,7 +44326,7 @@ export const proto = $root.proto = (() => { if (typeof m.mediaKeyTimestamp === "number") d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; else - d.mediaKeyTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.mediaKeyTimestamp) : o.longs === Number ? new $util.LongBits(m.mediaKeyTimestamp.low >>> 0, m.mediaKeyTimestamp.high >>> 0).toNumber() : m.mediaKeyTimestamp; + d.mediaKeyTimestamp = o.longs === String ? longToString(m.mediaKeyTimestamp) : o.longs === Number ? longToNumber(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; if (o.oneofs) d._mediaKeyTimestamp = "mediaKeyTimestamp"; } @@ -44819,7 +44856,7 @@ export const proto = $root.proto = (() => { if (typeof m.inviteExpiration === "number") d.inviteExpiration = o.longs === String ? String(m.inviteExpiration) : m.inviteExpiration; else - d.inviteExpiration = o.longs === String ? $util.Long.prototype.toString.call(m.inviteExpiration) : o.longs === Number ? new $util.LongBits(m.inviteExpiration.low >>> 0, m.inviteExpiration.high >>> 0).toNumber() : m.inviteExpiration; + d.inviteExpiration = o.longs === String ? longToString(m.inviteExpiration) : o.longs === Number ? longToNumber(m.inviteExpiration) : m.inviteExpiration; if (o.oneofs) d._inviteExpiration = "inviteExpiration"; } @@ -45365,7 +45402,7 @@ export const proto = $root.proto = (() => { if (typeof m.amount1000 === "number") d.amount1000 = o.longs === String ? String(m.amount1000) : m.amount1000; else - d.amount1000 = o.longs === String ? $util.Long.prototype.toString.call(m.amount1000) : o.longs === Number ? new $util.LongBits(m.amount1000.low >>> 0, m.amount1000.high >>> 0).toNumber() : m.amount1000; + d.amount1000 = o.longs === String ? longToString(m.amount1000) : o.longs === Number ? longToNumber(m.amount1000) : m.amount1000; if (o.oneofs) d._amount1000 = "amount1000"; } @@ -45845,7 +45882,7 @@ export const proto = $root.proto = (() => { if (typeof m.timestamp === "number") d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp; else - d.timestamp = o.longs === String ? $util.Long.prototype.toString.call(m.timestamp) : o.longs === Number ? new $util.LongBits(m.timestamp.low >>> 0, m.timestamp.high >>> 0).toNumber() : m.timestamp; + d.timestamp = o.longs === String ? longToString(m.timestamp) : o.longs === Number ? longToNumber(m.timestamp) : m.timestamp; if (o.oneofs) d._timestamp = "timestamp"; } @@ -46333,7 +46370,7 @@ export const proto = $root.proto = (() => { if (typeof m.fileLength === "number") d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength; else - d.fileLength = o.longs === String ? $util.Long.prototype.toString.call(m.fileLength) : o.longs === Number ? new $util.LongBits(m.fileLength.low >>> 0, m.fileLength.high >>> 0).toNumber(true) : m.fileLength; + d.fileLength = o.longs === String ? longToString(m.fileLength, true) : o.longs === Number ? longToNumber(m.fileLength, true) : m.fileLength; if (o.oneofs) d._fileLength = "fileLength"; } @@ -46376,7 +46413,7 @@ export const proto = $root.proto = (() => { if (typeof m.oldestMsgInChunkTimestampSec === "number") d.oldestMsgInChunkTimestampSec = o.longs === String ? String(m.oldestMsgInChunkTimestampSec) : m.oldestMsgInChunkTimestampSec; else - d.oldestMsgInChunkTimestampSec = o.longs === String ? $util.Long.prototype.toString.call(m.oldestMsgInChunkTimestampSec) : o.longs === Number ? new $util.LongBits(m.oldestMsgInChunkTimestampSec.low >>> 0, m.oldestMsgInChunkTimestampSec.high >>> 0).toNumber() : m.oldestMsgInChunkTimestampSec; + d.oldestMsgInChunkTimestampSec = o.longs === String ? longToString(m.oldestMsgInChunkTimestampSec) : o.longs === Number ? longToNumber(m.oldestMsgInChunkTimestampSec) : m.oldestMsgInChunkTimestampSec; if (o.oneofs) d._oldestMsgInChunkTimestampSec = "oldestMsgInChunkTimestampSec"; } @@ -47126,7 +47163,7 @@ export const proto = $root.proto = (() => { if (typeof m.fileLength === "number") d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength; else - d.fileLength = o.longs === String ? $util.Long.prototype.toString.call(m.fileLength) : o.longs === Number ? new $util.LongBits(m.fileLength.low >>> 0, m.fileLength.high >>> 0).toNumber(true) : m.fileLength; + d.fileLength = o.longs === String ? longToString(m.fileLength, true) : o.longs === Number ? longToNumber(m.fileLength, true) : m.fileLength; if (o.oneofs) d._fileLength = "fileLength"; } @@ -47165,7 +47202,7 @@ export const proto = $root.proto = (() => { if (typeof m.mediaKeyTimestamp === "number") d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; else - d.mediaKeyTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.mediaKeyTimestamp) : o.longs === Number ? new $util.LongBits(m.mediaKeyTimestamp.low >>> 0, m.mediaKeyTimestamp.high >>> 0).toNumber() : m.mediaKeyTimestamp; + d.mediaKeyTimestamp = o.longs === String ? longToString(m.mediaKeyTimestamp) : o.longs === Number ? longToNumber(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; if (o.oneofs) d._mediaKeyTimestamp = "mediaKeyTimestamp"; } @@ -49461,7 +49498,7 @@ export const proto = $root.proto = (() => { if (typeof m.attachmentMediaKeyTimestamp === "number") d.attachmentMediaKeyTimestamp = o.longs === String ? String(m.attachmentMediaKeyTimestamp) : m.attachmentMediaKeyTimestamp; else - d.attachmentMediaKeyTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.attachmentMediaKeyTimestamp) : o.longs === Number ? new $util.LongBits(m.attachmentMediaKeyTimestamp.low >>> 0, m.attachmentMediaKeyTimestamp.high >>> 0).toNumber() : m.attachmentMediaKeyTimestamp; + d.attachmentMediaKeyTimestamp = o.longs === String ? longToString(m.attachmentMediaKeyTimestamp) : o.longs === Number ? longToNumber(m.attachmentMediaKeyTimestamp) : m.attachmentMediaKeyTimestamp; if (o.oneofs) d._attachmentMediaKeyTimestamp = "attachmentMediaKeyTimestamp"; } @@ -49647,7 +49684,7 @@ export const proto = $root.proto = (() => { if (typeof m.timestampMs === "number") d.timestampMs = o.longs === String ? String(m.timestampMs) : m.timestampMs; else - d.timestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.timestampMs) : o.longs === Number ? new $util.LongBits(m.timestampMs.low >>> 0, m.timestampMs.high >>> 0).toNumber() : m.timestampMs; + d.timestampMs = o.longs === String ? longToString(m.timestampMs) : o.longs === Number ? longToNumber(m.timestampMs) : m.timestampMs; if (o.oneofs) d._timestampMs = "timestampMs"; } @@ -51494,7 +51531,7 @@ export const proto = $root.proto = (() => { if (typeof m.sequenceNumber === "number") d.sequenceNumber = o.longs === String ? String(m.sequenceNumber) : m.sequenceNumber; else - d.sequenceNumber = o.longs === String ? $util.Long.prototype.toString.call(m.sequenceNumber) : o.longs === Number ? new $util.LongBits(m.sequenceNumber.low >>> 0, m.sequenceNumber.high >>> 0).toNumber() : m.sequenceNumber; + d.sequenceNumber = o.longs === String ? longToString(m.sequenceNumber) : o.longs === Number ? longToNumber(m.sequenceNumber) : m.sequenceNumber; if (o.oneofs) d._sequenceNumber = "sequenceNumber"; } @@ -52097,7 +52134,7 @@ export const proto = $root.proto = (() => { if (typeof m.mediaKeyTimestamp === "number") d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; else - d.mediaKeyTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.mediaKeyTimestamp) : o.longs === Number ? new $util.LongBits(m.mediaKeyTimestamp.low >>> 0, m.mediaKeyTimestamp.high >>> 0).toNumber() : m.mediaKeyTimestamp; + d.mediaKeyTimestamp = o.longs === String ? longToString(m.mediaKeyTimestamp) : o.longs === Number ? longToNumber(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; if (o.oneofs) d._mediaKeyTimestamp = "mediaKeyTimestamp"; } @@ -52370,7 +52407,7 @@ export const proto = $root.proto = (() => { if (typeof m.mediaKeyTimestamp === "number") d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; else - d.mediaKeyTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.mediaKeyTimestamp) : o.longs === Number ? new $util.LongBits(m.mediaKeyTimestamp.low >>> 0, m.mediaKeyTimestamp.high >>> 0).toNumber() : m.mediaKeyTimestamp; + d.mediaKeyTimestamp = o.longs === String ? longToString(m.mediaKeyTimestamp) : o.longs === Number ? longToNumber(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; if (o.oneofs) d._mediaKeyTimestamp = "mediaKeyTimestamp"; } @@ -52530,7 +52567,7 @@ export const proto = $root.proto = (() => { if (typeof m.oldestMessageTimestamp === "number") d.oldestMessageTimestamp = o.longs === String ? String(m.oldestMessageTimestamp) : m.oldestMessageTimestamp; else - d.oldestMessageTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.oldestMessageTimestamp) : o.longs === Number ? new $util.LongBits(m.oldestMessageTimestamp.low >>> 0, m.oldestMessageTimestamp.high >>> 0).toNumber() : m.oldestMessageTimestamp; + d.oldestMessageTimestamp = o.longs === String ? longToString(m.oldestMessageTimestamp) : o.longs === Number ? longToNumber(m.oldestMessageTimestamp) : m.oldestMessageTimestamp; if (o.oneofs) d._oldestMessageTimestamp = "oldestMessageTimestamp"; } @@ -52538,7 +52575,7 @@ export const proto = $root.proto = (() => { if (typeof m.messageCount === "number") d.messageCount = o.longs === String ? String(m.messageCount) : m.messageCount; else - d.messageCount = o.longs === String ? $util.Long.prototype.toString.call(m.messageCount) : o.longs === Number ? new $util.LongBits(m.messageCount.low >>> 0, m.messageCount.high >>> 0).toNumber() : m.messageCount; + d.messageCount = o.longs === String ? longToString(m.messageCount) : o.longs === Number ? longToNumber(m.messageCount) : m.messageCount; if (o.oneofs) d._messageCount = "messageCount"; } @@ -52854,7 +52891,7 @@ export const proto = $root.proto = (() => { if (typeof m.inviteExpiration === "number") d.inviteExpiration = o.longs === String ? String(m.inviteExpiration) : m.inviteExpiration; else - d.inviteExpiration = o.longs === String ? $util.Long.prototype.toString.call(m.inviteExpiration) : o.longs === Number ? new $util.LongBits(m.inviteExpiration.low >>> 0, m.inviteExpiration.high >>> 0).toNumber() : m.inviteExpiration; + d.inviteExpiration = o.longs === String ? longToString(m.inviteExpiration) : o.longs === Number ? longToNumber(m.inviteExpiration) : m.inviteExpiration; if (o.oneofs) d._inviteExpiration = "inviteExpiration"; } @@ -53436,7 +53473,7 @@ export const proto = $root.proto = (() => { if (typeof m.totalAmount1000 === "number") d.totalAmount1000 = o.longs === String ? String(m.totalAmount1000) : m.totalAmount1000; else - d.totalAmount1000 = o.longs === String ? $util.Long.prototype.toString.call(m.totalAmount1000) : o.longs === Number ? new $util.LongBits(m.totalAmount1000.low >>> 0, m.totalAmount1000.high >>> 0).toNumber() : m.totalAmount1000; + d.totalAmount1000 = o.longs === String ? longToString(m.totalAmount1000) : o.longs === Number ? longToNumber(m.totalAmount1000) : m.totalAmount1000; if (o.oneofs) d._totalAmount1000 = "totalAmount1000"; } @@ -53745,7 +53782,7 @@ export const proto = $root.proto = (() => { if (typeof m.expiryTimestamp === "number") d.expiryTimestamp = o.longs === String ? String(m.expiryTimestamp) : m.expiryTimestamp; else - d.expiryTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.expiryTimestamp) : o.longs === Number ? new $util.LongBits(m.expiryTimestamp.low >>> 0, m.expiryTimestamp.high >>> 0).toNumber() : m.expiryTimestamp; + d.expiryTimestamp = o.longs === String ? longToString(m.expiryTimestamp) : o.longs === Number ? longToNumber(m.expiryTimestamp) : m.expiryTimestamp; if (o.oneofs) d._expiryTimestamp = "expiryTimestamp"; } @@ -55164,7 +55201,7 @@ export const proto = $root.proto = (() => { if (typeof m.oldestMsgTimestampMs === "number") d.oldestMsgTimestampMs = o.longs === String ? String(m.oldestMsgTimestampMs) : m.oldestMsgTimestampMs; else - d.oldestMsgTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.oldestMsgTimestampMs) : o.longs === Number ? new $util.LongBits(m.oldestMsgTimestampMs.low >>> 0, m.oldestMsgTimestampMs.high >>> 0).toNumber() : m.oldestMsgTimestampMs; + d.oldestMsgTimestampMs = o.longs === String ? longToString(m.oldestMsgTimestampMs) : o.longs === Number ? longToNumber(m.oldestMsgTimestampMs) : m.oldestMsgTimestampMs; if (o.oneofs) d._oldestMsgTimestampMs = "oldestMsgTimestampMs"; } @@ -55575,7 +55612,7 @@ export const proto = $root.proto = (() => { if (typeof m.timestamp === "number") d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp; else - d.timestamp = o.longs === String ? $util.Long.prototype.toString.call(m.timestamp) : o.longs === Number ? new $util.LongBits(m.timestamp.low >>> 0, m.timestamp.high >>> 0).toNumber() : m.timestamp; + d.timestamp = o.longs === String ? longToString(m.timestamp) : o.longs === Number ? longToNumber(m.timestamp) : m.timestamp; if (o.oneofs) d._timestamp = "timestamp"; } @@ -57164,7 +57201,7 @@ export const proto = $root.proto = (() => { if (typeof m.mediaKeyTimestampMs === "number") d.mediaKeyTimestampMs = o.longs === String ? String(m.mediaKeyTimestampMs) : m.mediaKeyTimestampMs; else - d.mediaKeyTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.mediaKeyTimestampMs) : o.longs === Number ? new $util.LongBits(m.mediaKeyTimestampMs.low >>> 0, m.mediaKeyTimestampMs.high >>> 0).toNumber() : m.mediaKeyTimestampMs; + d.mediaKeyTimestampMs = o.longs === String ? longToString(m.mediaKeyTimestampMs) : o.longs === Number ? longToNumber(m.mediaKeyTimestampMs) : m.mediaKeyTimestampMs; if (o.oneofs) d._mediaKeyTimestampMs = "mediaKeyTimestampMs"; } @@ -57780,7 +57817,7 @@ export const proto = $root.proto = (() => { if (typeof m.senderTimestampMs === "number") d.senderTimestampMs = o.longs === String ? String(m.senderTimestampMs) : m.senderTimestampMs; else - d.senderTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.senderTimestampMs) : o.longs === Number ? new $util.LongBits(m.senderTimestampMs.low >>> 0, m.senderTimestampMs.high >>> 0).toNumber() : m.senderTimestampMs; + d.senderTimestampMs = o.longs === String ? longToString(m.senderTimestampMs) : o.longs === Number ? longToNumber(m.senderTimestampMs) : m.senderTimestampMs; if (o.oneofs) d._senderTimestampMs = "senderTimestampMs"; } @@ -58697,7 +58734,7 @@ export const proto = $root.proto = (() => { if (typeof m.optionVoteCount === "number") d.optionVoteCount = o.longs === String ? String(m.optionVoteCount) : m.optionVoteCount; else - d.optionVoteCount = o.longs === String ? $util.Long.prototype.toString.call(m.optionVoteCount) : o.longs === Number ? new $util.LongBits(m.optionVoteCount.low >>> 0, m.optionVoteCount.high >>> 0).toNumber() : m.optionVoteCount; + d.optionVoteCount = o.longs === String ? longToString(m.optionVoteCount) : o.longs === Number ? longToNumber(m.optionVoteCount) : m.optionVoteCount; if (o.oneofs) d._optionVoteCount = "optionVoteCount"; } @@ -58874,7 +58911,7 @@ export const proto = $root.proto = (() => { if (typeof m.senderTimestampMs === "number") d.senderTimestampMs = o.longs === String ? String(m.senderTimestampMs) : m.senderTimestampMs; else - d.senderTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.senderTimestampMs) : o.longs === Number ? new $util.LongBits(m.senderTimestampMs.low >>> 0, m.senderTimestampMs.high >>> 0).toNumber() : m.senderTimestampMs; + d.senderTimestampMs = o.longs === String ? longToString(m.senderTimestampMs) : o.longs === Number ? longToNumber(m.senderTimestampMs) : m.senderTimestampMs; if (o.oneofs) d._senderTimestampMs = "senderTimestampMs"; } @@ -59667,7 +59704,7 @@ export const proto = $root.proto = (() => { if (typeof m.priceAmount1000 === "number") d.priceAmount1000 = o.longs === String ? String(m.priceAmount1000) : m.priceAmount1000; else - d.priceAmount1000 = o.longs === String ? $util.Long.prototype.toString.call(m.priceAmount1000) : o.longs === Number ? new $util.LongBits(m.priceAmount1000.low >>> 0, m.priceAmount1000.high >>> 0).toNumber() : m.priceAmount1000; + d.priceAmount1000 = o.longs === String ? longToString(m.priceAmount1000) : o.longs === Number ? longToNumber(m.priceAmount1000) : m.priceAmount1000; if (o.oneofs) d._priceAmount1000 = "priceAmount1000"; } @@ -59695,7 +59732,7 @@ export const proto = $root.proto = (() => { if (typeof m.salePriceAmount1000 === "number") d.salePriceAmount1000 = o.longs === String ? String(m.salePriceAmount1000) : m.salePriceAmount1000; else - d.salePriceAmount1000 = o.longs === String ? $util.Long.prototype.toString.call(m.salePriceAmount1000) : o.longs === Number ? new $util.LongBits(m.salePriceAmount1000.low >>> 0, m.salePriceAmount1000.high >>> 0).toNumber() : m.salePriceAmount1000; + d.salePriceAmount1000 = o.longs === String ? longToString(m.salePriceAmount1000) : o.longs === Number ? longToNumber(m.salePriceAmount1000) : m.salePriceAmount1000; if (o.oneofs) d._salePriceAmount1000 = "salePriceAmount1000"; } @@ -60339,7 +60376,7 @@ export const proto = $root.proto = (() => { if (typeof m.ephemeralSettingTimestamp === "number") d.ephemeralSettingTimestamp = o.longs === String ? String(m.ephemeralSettingTimestamp) : m.ephemeralSettingTimestamp; else - d.ephemeralSettingTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.ephemeralSettingTimestamp) : o.longs === Number ? new $util.LongBits(m.ephemeralSettingTimestamp.low >>> 0, m.ephemeralSettingTimestamp.high >>> 0).toNumber() : m.ephemeralSettingTimestamp; + d.ephemeralSettingTimestamp = o.longs === String ? longToString(m.ephemeralSettingTimestamp) : o.longs === Number ? longToNumber(m.ephemeralSettingTimestamp) : m.ephemeralSettingTimestamp; if (o.oneofs) d._ephemeralSettingTimestamp = "ephemeralSettingTimestamp"; } @@ -60382,7 +60419,7 @@ export const proto = $root.proto = (() => { if (typeof m.timestampMs === "number") d.timestampMs = o.longs === String ? String(m.timestampMs) : m.timestampMs; else - d.timestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.timestampMs) : o.longs === Number ? new $util.LongBits(m.timestampMs.low >>> 0, m.timestampMs.high >>> 0).toNumber() : m.timestampMs; + d.timestampMs = o.longs === String ? longToString(m.timestampMs) : o.longs === Number ? longToNumber(m.timestampMs) : m.timestampMs; if (o.oneofs) d._timestampMs = "timestampMs"; } @@ -60747,7 +60784,7 @@ export const proto = $root.proto = (() => { if (typeof m.senderTimestampMs === "number") d.senderTimestampMs = o.longs === String ? String(m.senderTimestampMs) : m.senderTimestampMs; else - d.senderTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.senderTimestampMs) : o.longs === Number ? new $util.LongBits(m.senderTimestampMs.low >>> 0, m.senderTimestampMs.high >>> 0).toNumber() : m.senderTimestampMs; + d.senderTimestampMs = o.longs === String ? longToString(m.senderTimestampMs) : o.longs === Number ? longToNumber(m.senderTimestampMs) : m.senderTimestampMs; if (o.oneofs) d._senderTimestampMs = "senderTimestampMs"; } @@ -60959,7 +60996,7 @@ export const proto = $root.proto = (() => { if (typeof m.amount1000 === "number") d.amount1000 = o.longs === String ? String(m.amount1000) : m.amount1000; else - d.amount1000 = o.longs === String ? $util.Long.prototype.toString.call(m.amount1000) : o.longs === Number ? new $util.LongBits(m.amount1000.low >>> 0, m.amount1000.high >>> 0).toNumber(true) : m.amount1000; + d.amount1000 = o.longs === String ? longToString(m.amount1000, true) : o.longs === Number ? longToNumber(m.amount1000, true) : m.amount1000; if (o.oneofs) d._amount1000 = "amount1000"; } @@ -60977,7 +61014,7 @@ export const proto = $root.proto = (() => { if (typeof m.expiryTimestamp === "number") d.expiryTimestamp = o.longs === String ? String(m.expiryTimestamp) : m.expiryTimestamp; else - d.expiryTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.expiryTimestamp) : o.longs === Number ? new $util.LongBits(m.expiryTimestamp.low >>> 0, m.expiryTimestamp.high >>> 0).toNumber() : m.expiryTimestamp; + d.expiryTimestamp = o.longs === String ? longToString(m.expiryTimestamp) : o.longs === Number ? longToNumber(m.expiryTimestamp) : m.expiryTimestamp; if (o.oneofs) d._expiryTimestamp = "expiryTimestamp"; } @@ -61332,7 +61369,7 @@ export const proto = $root.proto = (() => { if (typeof m.scheduledTimestampMs === "number") d.scheduledTimestampMs = o.longs === String ? String(m.scheduledTimestampMs) : m.scheduledTimestampMs; else - d.scheduledTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.scheduledTimestampMs) : o.longs === Number ? new $util.LongBits(m.scheduledTimestampMs.low >>> 0, m.scheduledTimestampMs.high >>> 0).toNumber() : m.scheduledTimestampMs; + d.scheduledTimestampMs = o.longs === String ? longToString(m.scheduledTimestampMs) : o.longs === Number ? longToNumber(m.scheduledTimestampMs) : m.scheduledTimestampMs; if (o.oneofs) d._scheduledTimestampMs = "scheduledTimestampMs"; } @@ -63046,7 +63083,7 @@ export const proto = $root.proto = (() => { if (typeof m.fileLength === "number") d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength; else - d.fileLength = o.longs === String ? $util.Long.prototype.toString.call(m.fileLength) : o.longs === Number ? new $util.LongBits(m.fileLength.low >>> 0, m.fileLength.high >>> 0).toNumber(true) : m.fileLength; + d.fileLength = o.longs === String ? longToString(m.fileLength, true) : o.longs === Number ? longToNumber(m.fileLength, true) : m.fileLength; if (o.oneofs) d._fileLength = "fileLength"; } @@ -63054,7 +63091,7 @@ export const proto = $root.proto = (() => { if (typeof m.mediaKeyTimestamp === "number") d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; else - d.mediaKeyTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.mediaKeyTimestamp) : o.longs === Number ? new $util.LongBits(m.mediaKeyTimestamp.low >>> 0, m.mediaKeyTimestamp.high >>> 0).toNumber() : m.mediaKeyTimestamp; + d.mediaKeyTimestamp = o.longs === String ? longToString(m.mediaKeyTimestamp) : o.longs === Number ? longToNumber(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; if (o.oneofs) d._mediaKeyTimestamp = "mediaKeyTimestamp"; } @@ -63087,7 +63124,7 @@ export const proto = $root.proto = (() => { if (typeof m.stickerSentTs === "number") d.stickerSentTs = o.longs === String ? String(m.stickerSentTs) : m.stickerSentTs; else - d.stickerSentTs = o.longs === String ? $util.Long.prototype.toString.call(m.stickerSentTs) : o.longs === Number ? new $util.LongBits(m.stickerSentTs.low >>> 0, m.stickerSentTs.high >>> 0).toNumber() : m.stickerSentTs; + d.stickerSentTs = o.longs === String ? longToString(m.stickerSentTs) : o.longs === Number ? longToNumber(m.stickerSentTs) : m.stickerSentTs; if (o.oneofs) d._stickerSentTs = "stickerSentTs"; } @@ -63624,7 +63661,7 @@ export const proto = $root.proto = (() => { if (typeof m.fileLength === "number") d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength; else - d.fileLength = o.longs === String ? $util.Long.prototype.toString.call(m.fileLength) : o.longs === Number ? new $util.LongBits(m.fileLength.low >>> 0, m.fileLength.high >>> 0).toNumber(true) : m.fileLength; + d.fileLength = o.longs === String ? longToString(m.fileLength, true) : o.longs === Number ? longToNumber(m.fileLength, true) : m.fileLength; if (o.oneofs) d._fileLength = "fileLength"; } @@ -63667,7 +63704,7 @@ export const proto = $root.proto = (() => { if (typeof m.mediaKeyTimestamp === "number") d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; else - d.mediaKeyTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.mediaKeyTimestamp) : o.longs === Number ? new $util.LongBits(m.mediaKeyTimestamp.low >>> 0, m.mediaKeyTimestamp.high >>> 0).toNumber() : m.mediaKeyTimestamp; + d.mediaKeyTimestamp = o.longs === String ? longToString(m.mediaKeyTimestamp) : o.longs === Number ? longToNumber(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; if (o.oneofs) d._mediaKeyTimestamp = "mediaKeyTimestamp"; } @@ -63710,7 +63747,7 @@ export const proto = $root.proto = (() => { if (typeof m.stickerPackSize === "number") d.stickerPackSize = o.longs === String ? String(m.stickerPackSize) : m.stickerPackSize; else - d.stickerPackSize = o.longs === String ? $util.Long.prototype.toString.call(m.stickerPackSize) : o.longs === Number ? new $util.LongBits(m.stickerPackSize.low >>> 0, m.stickerPackSize.high >>> 0).toNumber(true) : m.stickerPackSize; + d.stickerPackSize = o.longs === String ? longToString(m.stickerPackSize, true) : o.longs === Number ? longToNumber(m.stickerPackSize, true) : m.stickerPackSize; if (o.oneofs) d._stickerPackSize = "stickerPackSize"; } @@ -64072,7 +64109,7 @@ export const proto = $root.proto = (() => { if (typeof m.requestTimestamp === "number") d.requestTimestamp = o.longs === String ? String(m.requestTimestamp) : m.requestTimestamp; else - d.requestTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.requestTimestamp) : o.longs === Number ? new $util.LongBits(m.requestTimestamp.low >>> 0, m.requestTimestamp.high >>> 0).toNumber() : m.requestTimestamp; + d.requestTimestamp = o.longs === String ? longToString(m.requestTimestamp) : o.longs === Number ? longToNumber(m.requestTimestamp) : m.requestTimestamp; if (o.oneofs) d._requestTimestamp = "requestTimestamp"; } @@ -65863,7 +65900,7 @@ export const proto = $root.proto = (() => { if (typeof m.fileLength === "number") d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength; else - d.fileLength = o.longs === String ? $util.Long.prototype.toString.call(m.fileLength) : o.longs === Number ? new $util.LongBits(m.fileLength.low >>> 0, m.fileLength.high >>> 0).toNumber(true) : m.fileLength; + d.fileLength = o.longs === String ? longToString(m.fileLength, true) : o.longs === Number ? longToNumber(m.fileLength, true) : m.fileLength; if (o.oneofs) d._fileLength = "fileLength"; } @@ -65917,7 +65954,7 @@ export const proto = $root.proto = (() => { if (typeof m.mediaKeyTimestamp === "number") d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; else - d.mediaKeyTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.mediaKeyTimestamp) : o.longs === Number ? new $util.LongBits(m.mediaKeyTimestamp.low >>> 0, m.mediaKeyTimestamp.high >>> 0).toNumber() : m.mediaKeyTimestamp; + d.mediaKeyTimestamp = o.longs === String ? longToString(m.mediaKeyTimestamp) : o.longs === Number ? longToNumber(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; if (o.oneofs) d._mediaKeyTimestamp = "mediaKeyTimestamp"; } @@ -65992,7 +66029,7 @@ export const proto = $root.proto = (() => { if (typeof m.motionPhotoPresentationOffsetMs === "number") d.motionPhotoPresentationOffsetMs = o.longs === String ? String(m.motionPhotoPresentationOffsetMs) : m.motionPhotoPresentationOffsetMs; else - d.motionPhotoPresentationOffsetMs = o.longs === String ? $util.Long.prototype.toString.call(m.motionPhotoPresentationOffsetMs) : o.longs === Number ? new $util.LongBits(m.motionPhotoPresentationOffsetMs.low >>> 0, m.motionPhotoPresentationOffsetMs.high >>> 0).toNumber(true) : m.motionPhotoPresentationOffsetMs; + d.motionPhotoPresentationOffsetMs = o.longs === String ? longToString(m.motionPhotoPresentationOffsetMs, true) : o.longs === Number ? longToNumber(m.motionPhotoPresentationOffsetMs, true) : m.motionPhotoPresentationOffsetMs; if (o.oneofs) d._motionPhotoPresentationOffsetMs = "motionPhotoPresentationOffsetMs"; } @@ -66315,7 +66352,7 @@ export const proto = $root.proto = (() => { if (typeof m.senderTimestampMs === "number") d.senderTimestampMs = o.longs === String ? String(m.senderTimestampMs) : m.senderTimestampMs; else - d.senderTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.senderTimestampMs) : o.longs === Number ? new $util.LongBits(m.senderTimestampMs.low >>> 0, m.senderTimestampMs.high >>> 0).toNumber() : m.senderTimestampMs; + d.senderTimestampMs = o.longs === String ? longToString(m.senderTimestampMs) : o.longs === Number ? longToNumber(m.senderTimestampMs) : m.senderTimestampMs; if (o.oneofs) d._senderTimestampMs = "senderTimestampMs"; } @@ -66323,7 +66360,7 @@ export const proto = $root.proto = (() => { if (typeof m.serverTimestampMs === "number") d.serverTimestampMs = o.longs === String ? String(m.serverTimestampMs) : m.serverTimestampMs; else - d.serverTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.serverTimestampMs) : o.longs === Number ? new $util.LongBits(m.serverTimestampMs.low >>> 0, m.serverTimestampMs.high >>> 0).toNumber() : m.serverTimestampMs; + d.serverTimestampMs = o.longs === String ? longToString(m.serverTimestampMs) : o.longs === Number ? longToNumber(m.serverTimestampMs) : m.serverTimestampMs; if (o.oneofs) d._serverTimestampMs = "serverTimestampMs"; } @@ -67599,7 +67636,7 @@ export const proto = $root.proto = (() => { if (typeof m.value === "number") d.value = o.longs === String ? String(m.value) : m.value; else - d.value = o.longs === String ? $util.Long.prototype.toString.call(m.value) : o.longs === Number ? new $util.LongBits(m.value.low >>> 0, m.value.high >>> 0).toNumber() : m.value; + d.value = o.longs === String ? longToString(m.value) : o.longs === Number ? longToNumber(m.value) : m.value; if (o.oneofs) d._value = "value"; } @@ -68548,7 +68585,7 @@ export const proto = $root.proto = (() => { if (typeof m.senderTimestampMs === "number") d.senderTimestampMs = o.longs === String ? String(m.senderTimestampMs) : m.senderTimestampMs; else - d.senderTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.senderTimestampMs) : o.longs === Number ? new $util.LongBits(m.senderTimestampMs.low >>> 0, m.senderTimestampMs.high >>> 0).toNumber() : m.senderTimestampMs; + d.senderTimestampMs = o.longs === String ? longToString(m.senderTimestampMs) : o.longs === Number ? longToNumber(m.senderTimestampMs) : m.senderTimestampMs; if (o.oneofs) d._senderTimestampMs = "senderTimestampMs"; } @@ -68626,7 +68663,7 @@ export const proto = $root.proto = (() => { if (typeof m.eventStartTime === "number") d.eventStartTime = o.longs === String ? String(m.eventStartTime) : m.eventStartTime; else - d.eventStartTime = o.longs === String ? $util.Long.prototype.toString.call(m.eventStartTime) : o.longs === Number ? new $util.LongBits(m.eventStartTime.low >>> 0, m.eventStartTime.high >>> 0).toNumber() : m.eventStartTime; + d.eventStartTime = o.longs === String ? longToString(m.eventStartTime) : o.longs === Number ? longToNumber(m.eventStartTime) : m.eventStartTime; if (o.oneofs) d._eventStartTime = "eventStartTime"; } @@ -68639,7 +68676,7 @@ export const proto = $root.proto = (() => { if (typeof m.eventEndTime === "number") d.eventEndTime = o.longs === String ? String(m.eventEndTime) : m.eventEndTime; else - d.eventEndTime = o.longs === String ? $util.Long.prototype.toString.call(m.eventEndTime) : o.longs === Number ? new $util.LongBits(m.eventEndTime.low >>> 0, m.eventEndTime.high >>> 0).toNumber() : m.eventEndTime; + d.eventEndTime = o.longs === String ? longToString(m.eventEndTime) : o.longs === Number ? longToNumber(m.eventEndTime) : m.eventEndTime; if (o.oneofs) d._eventEndTime = "eventEndTime"; } @@ -69684,7 +69721,7 @@ export const proto = $root.proto = (() => { if (typeof m.expires === "number") d.expires = o.longs === String ? String(m.expires) : m.expires; else - d.expires = o.longs === String ? $util.Long.prototype.toString.call(m.expires) : o.longs === Number ? new $util.LongBits(m.expires.low >>> 0, m.expires.high >>> 0).toNumber(true) : m.expires; + d.expires = o.longs === String ? longToString(m.expires, true) : o.longs === Number ? longToNumber(m.expires, true) : m.expires; if (o.oneofs) d._expires = "expires"; } @@ -69857,7 +69894,7 @@ export const proto = $root.proto = (() => { if (typeof m.messageTimestamp === "number") d.messageTimestamp = o.longs === String ? String(m.messageTimestamp) : m.messageTimestamp; else - d.messageTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.messageTimestamp) : o.longs === Number ? new $util.LongBits(m.messageTimestamp.low >>> 0, m.messageTimestamp.high >>> 0).toNumber(true) : m.messageTimestamp; + d.messageTimestamp = o.longs === String ? longToString(m.messageTimestamp, true) : o.longs === Number ? longToNumber(m.messageTimestamp, true) : m.messageTimestamp; if (o.oneofs) d._messageTimestamp = "messageTimestamp"; } @@ -70347,7 +70384,7 @@ export const proto = $root.proto = (() => { if (typeof m.leaveTs === "number") d.leaveTs = o.longs === String ? String(m.leaveTs) : m.leaveTs; else - d.leaveTs = o.longs === String ? $util.Long.prototype.toString.call(m.leaveTs) : o.longs === Number ? new $util.LongBits(m.leaveTs.low >>> 0, m.leaveTs.high >>> 0).toNumber(true) : m.leaveTs; + d.leaveTs = o.longs === String ? longToString(m.leaveTs, true) : o.longs === Number ? longToNumber(m.leaveTs, true) : m.leaveTs; if (o.oneofs) d._leaveTs = "leaveTs"; } @@ -71121,7 +71158,7 @@ export const proto = $root.proto = (() => { if (typeof m.fileLength === "number") d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength; else - d.fileLength = o.longs === String ? $util.Long.prototype.toString.call(m.fileLength) : o.longs === Number ? new $util.LongBits(m.fileLength.low >>> 0, m.fileLength.high >>> 0).toNumber(true) : m.fileLength; + d.fileLength = o.longs === String ? longToString(m.fileLength, true) : o.longs === Number ? longToNumber(m.fileLength, true) : m.fileLength; if (o.oneofs) d._fileLength = "fileLength"; } @@ -71334,7 +71371,7 @@ export const proto = $root.proto = (() => { if (typeof m.mediaKeyTimestamp === "number") d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; else - d.mediaKeyTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.mediaKeyTimestamp) : o.longs === Number ? new $util.LongBits(m.mediaKeyTimestamp.low >>> 0, m.mediaKeyTimestamp.high >>> 0).toNumber() : m.mediaKeyTimestamp; + d.mediaKeyTimestamp = o.longs === String ? longToString(m.mediaKeyTimestamp) : o.longs === Number ? longToNumber(m.mediaKeyTimestamp) : m.mediaKeyTimestamp; if (o.oneofs) d._mediaKeyTimestamp = "mediaKeyTimestamp"; } @@ -71873,7 +71910,7 @@ export const proto = $root.proto = (() => { if (typeof m.amount1000 === "number") d.amount1000 = o.longs === String ? String(m.amount1000) : m.amount1000; else - d.amount1000 = o.longs === String ? $util.Long.prototype.toString.call(m.amount1000) : o.longs === Number ? new $util.LongBits(m.amount1000.low >>> 0, m.amount1000.high >>> 0).toNumber(true) : m.amount1000; + d.amount1000 = o.longs === String ? longToString(m.amount1000, true) : o.longs === Number ? longToNumber(m.amount1000, true) : m.amount1000; if (o.oneofs) d._amount1000 = "amount1000"; } @@ -71891,7 +71928,7 @@ export const proto = $root.proto = (() => { if (typeof m.transactionTimestamp === "number") d.transactionTimestamp = o.longs === String ? String(m.transactionTimestamp) : m.transactionTimestamp; else - d.transactionTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.transactionTimestamp) : o.longs === Number ? new $util.LongBits(m.transactionTimestamp.low >>> 0, m.transactionTimestamp.high >>> 0).toNumber(true) : m.transactionTimestamp; + d.transactionTimestamp = o.longs === String ? longToString(m.transactionTimestamp, true) : o.longs === Number ? longToNumber(m.transactionTimestamp, true) : m.transactionTimestamp; if (o.oneofs) d._transactionTimestamp = "transactionTimestamp"; } @@ -71904,7 +71941,7 @@ export const proto = $root.proto = (() => { if (typeof m.expiryTimestamp === "number") d.expiryTimestamp = o.longs === String ? String(m.expiryTimestamp) : m.expiryTimestamp; else - d.expiryTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.expiryTimestamp) : o.longs === Number ? new $util.LongBits(m.expiryTimestamp.low >>> 0, m.expiryTimestamp.high >>> 0).toNumber(true) : m.expiryTimestamp; + d.expiryTimestamp = o.longs === String ? longToString(m.expiryTimestamp, true) : o.longs === Number ? longToNumber(m.expiryTimestamp, true) : m.expiryTimestamp; if (o.oneofs) d._expiryTimestamp = "expiryTimestamp"; } @@ -72440,7 +72477,7 @@ export const proto = $root.proto = (() => { if (typeof m.senderTimestampMs === "number") d.senderTimestampMs = o.longs === String ? String(m.senderTimestampMs) : m.senderTimestampMs; else - d.senderTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.senderTimestampMs) : o.longs === Number ? new $util.LongBits(m.senderTimestampMs.low >>> 0, m.senderTimestampMs.high >>> 0).toNumber() : m.senderTimestampMs; + d.senderTimestampMs = o.longs === String ? longToString(m.senderTimestampMs) : o.longs === Number ? longToNumber(m.senderTimestampMs) : m.senderTimestampMs; if (o.oneofs) d._senderTimestampMs = "senderTimestampMs"; } @@ -72448,7 +72485,7 @@ export const proto = $root.proto = (() => { if (typeof m.serverTimestampMs === "number") d.serverTimestampMs = o.longs === String ? String(m.serverTimestampMs) : m.serverTimestampMs; else - d.serverTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.serverTimestampMs) : o.longs === Number ? new $util.LongBits(m.serverTimestampMs.low >>> 0, m.serverTimestampMs.high >>> 0).toNumber() : m.serverTimestampMs; + d.serverTimestampMs = o.longs === String ? longToString(m.serverTimestampMs) : o.longs === Number ? longToNumber(m.serverTimestampMs) : m.serverTimestampMs; if (o.oneofs) d._serverTimestampMs = "serverTimestampMs"; } @@ -72998,7 +73035,7 @@ export const proto = $root.proto = (() => { if (typeof m.senderTimestampMs === "number") d.senderTimestampMs = o.longs === String ? String(m.senderTimestampMs) : m.senderTimestampMs; else - d.senderTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.senderTimestampMs) : o.longs === Number ? new $util.LongBits(m.senderTimestampMs.low >>> 0, m.senderTimestampMs.high >>> 0).toNumber() : m.senderTimestampMs; + d.senderTimestampMs = o.longs === String ? longToString(m.senderTimestampMs) : o.longs === Number ? longToNumber(m.senderTimestampMs) : m.senderTimestampMs; if (o.oneofs) d._senderTimestampMs = "senderTimestampMs"; } @@ -73006,7 +73043,7 @@ export const proto = $root.proto = (() => { if (typeof m.serverTimestampMs === "number") d.serverTimestampMs = o.longs === String ? String(m.serverTimestampMs) : m.serverTimestampMs; else - d.serverTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.serverTimestampMs) : o.longs === Number ? new $util.LongBits(m.serverTimestampMs.low >>> 0, m.serverTimestampMs.high >>> 0).toNumber() : m.serverTimestampMs; + d.serverTimestampMs = o.longs === String ? longToString(m.serverTimestampMs) : o.longs === Number ? longToNumber(m.serverTimestampMs) : m.serverTimestampMs; if (o.oneofs) d._serverTimestampMs = "serverTimestampMs"; } @@ -73821,7 +73858,7 @@ export const proto = $root.proto = (() => { if (typeof m.fileLength === "number") d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength; else - d.fileLength = o.longs === String ? $util.Long.prototype.toString.call(m.fileLength) : o.longs === Number ? new $util.LongBits(m.fileLength.low >>> 0, m.fileLength.high >>> 0).toNumber(true) : m.fileLength; + d.fileLength = o.longs === String ? longToString(m.fileLength, true) : o.longs === Number ? longToNumber(m.fileLength, true) : m.fileLength; if (o.oneofs) d._fileLength = "fileLength"; } @@ -74360,7 +74397,7 @@ export const proto = $root.proto = (() => { if (typeof m.senderTimestampMs === "number") d.senderTimestampMs = o.longs === String ? String(m.senderTimestampMs) : m.senderTimestampMs; else - d.senderTimestampMs = o.longs === String ? $util.Long.prototype.toString.call(m.senderTimestampMs) : o.longs === Number ? new $util.LongBits(m.senderTimestampMs.low >>> 0, m.senderTimestampMs.high >>> 0).toNumber() : m.senderTimestampMs; + d.senderTimestampMs = o.longs === String ? longToString(m.senderTimestampMs) : o.longs === Number ? longToNumber(m.senderTimestampMs) : m.senderTimestampMs; if (o.oneofs) d._senderTimestampMs = "senderTimestampMs"; } @@ -77487,7 +77524,7 @@ export const proto = $root.proto = (() => { if (typeof m.timestamp === "number") d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp; else - d.timestamp = o.longs === String ? $util.Long.prototype.toString.call(m.timestamp) : o.longs === Number ? new $util.LongBits(m.timestamp.low >>> 0, m.timestamp.high >>> 0).toNumber() : m.timestamp; + d.timestamp = o.longs === String ? longToString(m.timestamp) : o.longs === Number ? longToNumber(m.timestamp) : m.timestamp; if (o.oneofs) d._timestamp = "timestamp"; } @@ -78990,13 +79027,13 @@ export const proto = $root.proto = (() => { if (typeof m.campaignId === "number") d.campaignId = o.longs === String ? String(m.campaignId) : m.campaignId; else - d.campaignId = o.longs === String ? $util.Long.prototype.toString.call(m.campaignId) : o.longs === Number ? new $util.LongBits(m.campaignId.low >>> 0, m.campaignId.high >>> 0).toNumber(true) : m.campaignId; + d.campaignId = o.longs === String ? longToString(m.campaignId, true) : o.longs === Number ? longToNumber(m.campaignId, true) : m.campaignId; } if (m.campaignExpirationTimestamp != null && m.hasOwnProperty("campaignExpirationTimestamp")) { if (typeof m.campaignExpirationTimestamp === "number") d.campaignExpirationTimestamp = o.longs === String ? String(m.campaignExpirationTimestamp) : m.campaignExpirationTimestamp; else - d.campaignExpirationTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.campaignExpirationTimestamp) : o.longs === Number ? new $util.LongBits(m.campaignExpirationTimestamp.low >>> 0, m.campaignExpirationTimestamp.high >>> 0).toNumber(true) : m.campaignExpirationTimestamp; + d.campaignExpirationTimestamp = o.longs === String ? longToString(m.campaignExpirationTimestamp, true) : o.longs === Number ? longToNumber(m.campaignExpirationTimestamp, true) : m.campaignExpirationTimestamp; if (o.oneofs) d._campaignExpirationTimestamp = "campaignExpirationTimestamp"; } @@ -79358,7 +79395,7 @@ export const proto = $root.proto = (() => { if (typeof m.fileLength === "number") d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength; else - d.fileLength = o.longs === String ? $util.Long.prototype.toString.call(m.fileLength) : o.longs === Number ? new $util.LongBits(m.fileLength.low >>> 0, m.fileLength.high >>> 0).toNumber(true) : m.fileLength; + d.fileLength = o.longs === String ? longToString(m.fileLength, true) : o.longs === Number ? longToNumber(m.fileLength, true) : m.fileLength; if (o.oneofs) d._fileLength = "fileLength"; } @@ -79371,7 +79408,7 @@ export const proto = $root.proto = (() => { if (typeof m.lastStickerSentTs === "number") d.lastStickerSentTs = o.longs === String ? String(m.lastStickerSentTs) : m.lastStickerSentTs; else - d.lastStickerSentTs = o.longs === String ? $util.Long.prototype.toString.call(m.lastStickerSentTs) : o.longs === Number ? new $util.LongBits(m.lastStickerSentTs.low >>> 0, m.lastStickerSentTs.high >>> 0).toNumber() : m.lastStickerSentTs; + d.lastStickerSentTs = o.longs === String ? longToString(m.lastStickerSentTs) : o.longs === Number ? longToNumber(m.lastStickerSentTs) : m.lastStickerSentTs; if (o.oneofs) d._lastStickerSentTs = "lastStickerSentTs"; } @@ -80867,7 +80904,7 @@ export const proto = $root.proto = (() => { if (typeof m.timestamp === "number") d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp; else - d.timestamp = o.longs === String ? $util.Long.prototype.toString.call(m.timestamp) : o.longs === Number ? new $util.LongBits(m.timestamp.low >>> 0, m.timestamp.high >>> 0).toNumber() : m.timestamp; + d.timestamp = o.longs === String ? longToString(m.timestamp) : o.longs === Number ? longToNumber(m.timestamp) : m.timestamp; if (o.oneofs) d._timestamp = "timestamp"; } @@ -83471,7 +83508,7 @@ export const proto = $root.proto = (() => { if (typeof m.messageTimestamp === "number") d.messageTimestamp = o.longs === String ? String(m.messageTimestamp) : m.messageTimestamp; else - d.messageTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.messageTimestamp) : o.longs === Number ? new $util.LongBits(m.messageTimestamp.low >>> 0, m.messageTimestamp.high >>> 0).toNumber() : m.messageTimestamp; + d.messageTimestamp = o.longs === String ? longToString(m.messageTimestamp) : o.longs === Number ? longToNumber(m.messageTimestamp) : m.messageTimestamp; if (o.oneofs) d._messageTimestamp = "messageTimestamp"; } @@ -84414,7 +84451,7 @@ export const proto = $root.proto = (() => { if (typeof m.muteEndTimeMs === "number") d.muteEndTimeMs = o.longs === String ? String(m.muteEndTimeMs) : m.muteEndTimeMs; else - d.muteEndTimeMs = o.longs === String ? $util.Long.prototype.toString.call(m.muteEndTimeMs) : o.longs === Number ? new $util.LongBits(m.muteEndTimeMs.low >>> 0, m.muteEndTimeMs.high >>> 0).toNumber() : m.muteEndTimeMs; + d.muteEndTimeMs = o.longs === String ? longToString(m.muteEndTimeMs) : o.longs === Number ? longToNumber(m.muteEndTimeMs) : m.muteEndTimeMs; if (o.oneofs) d._muteEndTimeMs = "muteEndTimeMs"; } @@ -85285,7 +85322,7 @@ export const proto = $root.proto = (() => { if (typeof m.createdAt === "number") d.createdAt = o.longs === String ? String(m.createdAt) : m.createdAt; else - d.createdAt = o.longs === String ? $util.Long.prototype.toString.call(m.createdAt) : o.longs === Number ? new $util.LongBits(m.createdAt.low >>> 0, m.createdAt.high >>> 0).toNumber() : m.createdAt; + d.createdAt = o.longs === String ? longToString(m.createdAt) : o.longs === Number ? longToNumber(m.createdAt) : m.createdAt; if (o.oneofs) d._createdAt = "createdAt"; } @@ -85293,7 +85330,7 @@ export const proto = $root.proto = (() => { if (typeof m.lastSentAt === "number") d.lastSentAt = o.longs === String ? String(m.lastSentAt) : m.lastSentAt; else - d.lastSentAt = o.longs === String ? $util.Long.prototype.toString.call(m.lastSentAt) : o.longs === Number ? new $util.LongBits(m.lastSentAt.low >>> 0, m.lastSentAt.high >>> 0).toNumber() : m.lastSentAt; + d.lastSentAt = o.longs === String ? longToString(m.lastSentAt) : o.longs === Number ? longToNumber(m.lastSentAt) : m.lastSentAt; if (o.oneofs) d._lastSentAt = "lastSentAt"; } @@ -85827,7 +85864,7 @@ export const proto = $root.proto = (() => { if (typeof m.muteEndTimestamp === "number") d.muteEndTimestamp = o.longs === String ? String(m.muteEndTimestamp) : m.muteEndTimestamp; else - d.muteEndTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.muteEndTimestamp) : o.longs === Number ? new $util.LongBits(m.muteEndTimestamp.low >>> 0, m.muteEndTimestamp.high >>> 0).toNumber() : m.muteEndTimestamp; + d.muteEndTimestamp = o.longs === String ? longToString(m.muteEndTimestamp) : o.longs === Number ? longToNumber(m.muteEndTimestamp) : m.muteEndTimestamp; if (o.oneofs) d._muteEndTimestamp = "muteEndTimestamp"; } @@ -86105,7 +86142,7 @@ export const proto = $root.proto = (() => { if (typeof m.createdAt === "number") d.createdAt = o.longs === String ? String(m.createdAt) : m.createdAt; else - d.createdAt = o.longs === String ? $util.Long.prototype.toString.call(m.createdAt) : o.longs === Number ? new $util.LongBits(m.createdAt.low >>> 0, m.createdAt.high >>> 0).toNumber() : m.createdAt; + d.createdAt = o.longs === String ? longToString(m.createdAt) : o.longs === Number ? longToNumber(m.createdAt) : m.createdAt; if (o.oneofs) d._createdAt = "createdAt"; } @@ -87723,7 +87760,7 @@ export const proto = $root.proto = (() => { if (typeof m.lastStickerSentTs === "number") d.lastStickerSentTs = o.longs === String ? String(m.lastStickerSentTs) : m.lastStickerSentTs; else - d.lastStickerSentTs = o.longs === String ? $util.Long.prototype.toString.call(m.lastStickerSentTs) : o.longs === Number ? new $util.LongBits(m.lastStickerSentTs.low >>> 0, m.lastStickerSentTs.high >>> 0).toNumber() : m.lastStickerSentTs; + d.lastStickerSentTs = o.longs === String ? longToString(m.lastStickerSentTs) : o.longs === Number ? longToNumber(m.lastStickerSentTs) : m.lastStickerSentTs; if (o.oneofs) d._lastStickerSentTs = "lastStickerSentTs"; } @@ -88377,7 +88414,7 @@ export const proto = $root.proto = (() => { if (typeof m.fileLength === "number") d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength; else - d.fileLength = o.longs === String ? $util.Long.prototype.toString.call(m.fileLength) : o.longs === Number ? new $util.LongBits(m.fileLength.low >>> 0, m.fileLength.high >>> 0).toNumber(true) : m.fileLength; + d.fileLength = o.longs === String ? longToString(m.fileLength, true) : o.longs === Number ? longToNumber(m.fileLength, true) : m.fileLength; if (o.oneofs) d._fileLength = "fileLength"; } @@ -88542,7 +88579,7 @@ export const proto = $root.proto = (() => { if (typeof m.expirationDate === "number") d.expirationDate = o.longs === String ? String(m.expirationDate) : m.expirationDate; else - d.expirationDate = o.longs === String ? $util.Long.prototype.toString.call(m.expirationDate) : o.longs === Number ? new $util.LongBits(m.expirationDate.low >>> 0, m.expirationDate.high >>> 0).toNumber() : m.expirationDate; + d.expirationDate = o.longs === String ? longToString(m.expirationDate) : o.longs === Number ? longToNumber(m.expirationDate) : m.expirationDate; if (o.oneofs) d._expirationDate = "expirationDate"; } @@ -88663,7 +88700,7 @@ export const proto = $root.proto = (() => { if (typeof m.timestamp === "number") d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp; else - d.timestamp = o.longs === String ? $util.Long.prototype.toString.call(m.timestamp) : o.longs === Number ? new $util.LongBits(m.timestamp.low >>> 0, m.timestamp.high >>> 0).toNumber() : m.timestamp; + d.timestamp = o.longs === String ? longToString(m.timestamp) : o.longs === Number ? longToNumber(m.timestamp) : m.timestamp; if (o.oneofs) d._timestamp = "timestamp"; } @@ -88809,7 +88846,7 @@ export const proto = $root.proto = (() => { if (typeof m.lastMessageTimestamp === "number") d.lastMessageTimestamp = o.longs === String ? String(m.lastMessageTimestamp) : m.lastMessageTimestamp; else - d.lastMessageTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.lastMessageTimestamp) : o.longs === Number ? new $util.LongBits(m.lastMessageTimestamp.low >>> 0, m.lastMessageTimestamp.high >>> 0).toNumber() : m.lastMessageTimestamp; + d.lastMessageTimestamp = o.longs === String ? longToString(m.lastMessageTimestamp) : o.longs === Number ? longToNumber(m.lastMessageTimestamp) : m.lastMessageTimestamp; if (o.oneofs) d._lastMessageTimestamp = "lastMessageTimestamp"; } @@ -88817,7 +88854,7 @@ export const proto = $root.proto = (() => { if (typeof m.lastSystemMessageTimestamp === "number") d.lastSystemMessageTimestamp = o.longs === String ? String(m.lastSystemMessageTimestamp) : m.lastSystemMessageTimestamp; else - d.lastSystemMessageTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.lastSystemMessageTimestamp) : o.longs === Number ? new $util.LongBits(m.lastSystemMessageTimestamp.low >>> 0, m.lastSystemMessageTimestamp.high >>> 0).toNumber() : m.lastSystemMessageTimestamp; + d.lastSystemMessageTimestamp = o.longs === String ? longToString(m.lastSystemMessageTimestamp) : o.longs === Number ? longToNumber(m.lastSystemMessageTimestamp) : m.lastSystemMessageTimestamp; if (o.oneofs) d._lastSystemMessageTimestamp = "lastSystemMessageTimestamp"; } @@ -90584,7 +90621,7 @@ export const proto = $root.proto = (() => { if (typeof m.version === "number") d.version = o.longs === String ? String(m.version) : m.version; else - d.version = o.longs === String ? $util.Long.prototype.toString.call(m.version) : o.longs === Number ? new $util.LongBits(m.version.low >>> 0, m.version.high >>> 0).toNumber(true) : m.version; + d.version = o.longs === String ? longToString(m.version, true) : o.longs === Number ? longToNumber(m.version, true) : m.version; if (o.oneofs) d._version = "version"; } @@ -92186,7 +92223,7 @@ export const proto = $root.proto = (() => { if (typeof m.receiptTimestamp === "number") d.receiptTimestamp = o.longs === String ? String(m.receiptTimestamp) : m.receiptTimestamp; else - d.receiptTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.receiptTimestamp) : o.longs === Number ? new $util.LongBits(m.receiptTimestamp.low >>> 0, m.receiptTimestamp.high >>> 0).toNumber() : m.receiptTimestamp; + d.receiptTimestamp = o.longs === String ? longToString(m.receiptTimestamp) : o.longs === Number ? longToNumber(m.receiptTimestamp) : m.receiptTimestamp; if (o.oneofs) d._receiptTimestamp = "receiptTimestamp"; } @@ -92194,7 +92231,7 @@ export const proto = $root.proto = (() => { if (typeof m.readTimestamp === "number") d.readTimestamp = o.longs === String ? String(m.readTimestamp) : m.readTimestamp; else - d.readTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.readTimestamp) : o.longs === Number ? new $util.LongBits(m.readTimestamp.low >>> 0, m.readTimestamp.high >>> 0).toNumber() : m.readTimestamp; + d.readTimestamp = o.longs === String ? longToString(m.readTimestamp) : o.longs === Number ? longToNumber(m.readTimestamp) : m.readTimestamp; if (o.oneofs) d._readTimestamp = "readTimestamp"; } @@ -92202,7 +92239,7 @@ export const proto = $root.proto = (() => { if (typeof m.playedTimestamp === "number") d.playedTimestamp = o.longs === String ? String(m.playedTimestamp) : m.playedTimestamp; else - d.playedTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.playedTimestamp) : o.longs === Number ? new $util.LongBits(m.playedTimestamp.low >>> 0, m.playedTimestamp.high >>> 0).toNumber() : m.playedTimestamp; + d.playedTimestamp = o.longs === String ? longToString(m.playedTimestamp) : o.longs === Number ? longToNumber(m.playedTimestamp) : m.playedTimestamp; if (o.oneofs) d._playedTimestamp = "playedTimestamp"; } @@ -92528,7 +92565,7 @@ export const proto = $root.proto = (() => { if (typeof m.serial === "number") d.serial = o.longs === String ? String(m.serial) : m.serial; else - d.serial = o.longs === String ? $util.Long.prototype.toString.call(m.serial) : o.longs === Number ? new $util.LongBits(m.serial.low >>> 0, m.serial.high >>> 0).toNumber(true) : m.serial; + d.serial = o.longs === String ? longToString(m.serial, true) : o.longs === Number ? longToNumber(m.serial, true) : m.serial; if (o.oneofs) d._serial = "serial"; } @@ -92552,7 +92589,7 @@ export const proto = $root.proto = (() => { if (typeof m.issueTime === "number") d.issueTime = o.longs === String ? String(m.issueTime) : m.issueTime; else - d.issueTime = o.longs === String ? $util.Long.prototype.toString.call(m.issueTime) : o.longs === Number ? new $util.LongBits(m.issueTime.low >>> 0, m.issueTime.high >>> 0).toNumber(true) : m.issueTime; + d.issueTime = o.longs === String ? longToString(m.issueTime, true) : o.longs === Number ? longToNumber(m.issueTime, true) : m.issueTime; if (o.oneofs) d._issueTime = "issueTime"; } @@ -96868,7 +96905,7 @@ export const proto = $root.proto = (() => { if (typeof m.messageTimestamp === "number") d.messageTimestamp = o.longs === String ? String(m.messageTimestamp) : m.messageTimestamp; else - d.messageTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.messageTimestamp) : o.longs === Number ? new $util.LongBits(m.messageTimestamp.low >>> 0, m.messageTimestamp.high >>> 0).toNumber(true) : m.messageTimestamp; + d.messageTimestamp = o.longs === String ? longToString(m.messageTimestamp, true) : o.longs === Number ? longToNumber(m.messageTimestamp, true) : m.messageTimestamp; if (o.oneofs) d._messageTimestamp = "messageTimestamp"; } @@ -96886,7 +96923,7 @@ export const proto = $root.proto = (() => { if (typeof m.messageC2STimestamp === "number") d.messageC2STimestamp = o.longs === String ? String(m.messageC2STimestamp) : m.messageC2STimestamp; else - d.messageC2STimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.messageC2STimestamp) : o.longs === Number ? new $util.LongBits(m.messageC2STimestamp.low >>> 0, m.messageC2STimestamp.high >>> 0).toNumber(true) : m.messageC2STimestamp; + d.messageC2STimestamp = o.longs === String ? longToString(m.messageC2STimestamp, true) : o.longs === Number ? longToNumber(m.messageC2STimestamp, true) : m.messageC2STimestamp; if (o.oneofs) d._messageC2STimestamp = "messageC2STimestamp"; } @@ -96976,7 +97013,7 @@ export const proto = $root.proto = (() => { if (typeof m.ephemeralStartTimestamp === "number") d.ephemeralStartTimestamp = o.longs === String ? String(m.ephemeralStartTimestamp) : m.ephemeralStartTimestamp; else - d.ephemeralStartTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.ephemeralStartTimestamp) : o.longs === Number ? new $util.LongBits(m.ephemeralStartTimestamp.low >>> 0, m.ephemeralStartTimestamp.high >>> 0).toNumber(true) : m.ephemeralStartTimestamp; + d.ephemeralStartTimestamp = o.longs === String ? longToString(m.ephemeralStartTimestamp, true) : o.longs === Number ? longToNumber(m.ephemeralStartTimestamp, true) : m.ephemeralStartTimestamp; if (o.oneofs) d._ephemeralStartTimestamp = "ephemeralStartTimestamp"; } @@ -97082,7 +97119,7 @@ export const proto = $root.proto = (() => { if (typeof m.revokeMessageTimestamp === "number") d.revokeMessageTimestamp = o.longs === String ? String(m.revokeMessageTimestamp) : m.revokeMessageTimestamp; else - d.revokeMessageTimestamp = o.longs === String ? $util.Long.prototype.toString.call(m.revokeMessageTimestamp) : o.longs === Number ? new $util.LongBits(m.revokeMessageTimestamp.low >>> 0, m.revokeMessageTimestamp.high >>> 0).toNumber(true) : m.revokeMessageTimestamp; + d.revokeMessageTimestamp = o.longs === String ? longToString(m.revokeMessageTimestamp, true) : o.longs === Number ? longToNumber(m.revokeMessageTimestamp, true) : m.revokeMessageTimestamp; if (o.oneofs) d._revokeMessageTimestamp = "revokeMessageTimestamp"; } @@ -97131,7 +97168,7 @@ export const proto = $root.proto = (() => { if (typeof m.newsletterServerId === "number") d.newsletterServerId = o.longs === String ? String(m.newsletterServerId) : m.newsletterServerId; else - d.newsletterServerId = o.longs === String ? $util.Long.prototype.toString.call(m.newsletterServerId) : o.longs === Number ? new $util.LongBits(m.newsletterServerId.low >>> 0, m.newsletterServerId.high >>> 0).toNumber(true) : m.newsletterServerId; + d.newsletterServerId = o.longs === String ? longToString(m.newsletterServerId, true) : o.longs === Number ? longToNumber(m.newsletterServerId, true) : m.newsletterServerId; if (o.oneofs) d._newsletterServerId = "newsletterServerId"; } @@ -97607,7 +97644,7 @@ export const proto = $root.proto = (() => { if (typeof m.timestamp === "number") d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp; else - d.timestamp = o.longs === String ? $util.Long.prototype.toString.call(m.timestamp) : o.longs === Number ? new $util.LongBits(m.timestamp.low >>> 0, m.timestamp.high >>> 0).toNumber(true) : m.timestamp; + d.timestamp = o.longs === String ? longToString(m.timestamp, true) : o.longs === Number ? longToNumber(m.timestamp, true) : m.timestamp; if (o.oneofs) d._timestamp = "timestamp"; } diff --git a/src/__tests__/proto-tojson-long.test.ts b/src/__tests__/proto-tojson-long.test.ts new file mode 100644 index 00000000..bf034795 --- /dev/null +++ b/src/__tests__/proto-tojson-long.test.ts @@ -0,0 +1,31 @@ +import '../index.js' +import { proto } from '../../WAProto/index.js' + +describe('proto serialization', () => { + it('handles string values in long fields gracefully', () => { + const message = proto.WebMessageInfo.fromObject({ + key: { + remoteJid: '123@s.whatsapp.net', + id: 'ABC123', + fromMe: false + }, + messageTimestamp: 1, + message: { + imageMessage: { + fileLength: 42 + } + } + }) + + const imageMessage = message.message?.imageMessage + if (!imageMessage) { + throw new Error('imageMessage missing in test setup') + } + + ;(imageMessage as unknown as { fileLength: unknown }).fileLength = '1234567890123456789' + + expect(() => JSON.stringify(message)).not.toThrow() + const json = message.toJSON() + expect(json.message?.imageMessage?.fileLength).toBe('1234567890123456789') + }) +})