MCPcopy Create free account
hub / github.com/TGX-Android/Publisher / getChecksumMessage

Function getChecksumMessage

main.js:3590–3639  ·  view source on GitHub ↗
(checksum, apk, displayChecksum)

Source from the content-addressed store, hash-verified

3588}
3589
3590function getChecksumMessage (checksum, apk, displayChecksum) {
3591 let text = '';
3592 if (displayChecksum) {
3593 text += '<code>' + checksum + '</code> is a ';
3594 if (apk.hashAlgorithm) {
3595 text += '<b>' + toDisplayAlgorithm(apk.hashAlgorithm) + '</b> ';
3596 }
3597 text += 'hash that ';
3598 } else {
3599 text += 'This ';
3600 if (apk.hashAlgorithm) {
3601 text += '<b>' + toDisplayAlgorithm(apk.hashAlgorithm) + '</b> ';
3602 }
3603 text += 'hash ';
3604 }
3605
3606 text += 'corresponds to ';
3607 text += '<b>' + (!apk.branch || apk.branch === 'main' ? 'official' : 'unofficial') + ' Telegram X</b> build.';
3608
3609 ALL_PLATFORMS.forEach((platform) => {
3610 if (apk[platform + 'Track']) {
3611 switch (platform) {
3612 case 'googlePlay': {
3613 text += '\n\n';
3614 text += 'This build was published to <b>Google Play' + (apk.googlePlayTrack === 'stable' ? '' : ' ' + ucfirst(apk.googlePlayTrack)) + '</b>.';
3615 break;
3616 }
3617 case 'huawei': {
3618 text += '\n\n';
3619 text += 'This build was published to <b>Huawei AppGallery</b>.';
3620 }
3621 }
3622 }
3623 })
3624
3625 text += '\n\n';
3626 text += '<b>Version</b>: <code>' + apk.version.name +
3627 (apk.sdkVariant && apk.sdkVariant !== 'latest' ? '-' + apk.sdkVariant : '') +
3628 '-' + getDisplayVariant(apk.abiVariant || apk.variant || 'unknown') +
3629 '</code>\n';
3630 text += '<b>Commit</b>: <a href="' + apk.remoteUrl + '/tree/' + apk.commit.long + '">' + apk.commit.short + '</a>';
3631 if (apk.date) {
3632 text += ', ' + toDisplayDate(apk.date);
3633 }
3634 if (apk.pullRequestsMetadata || !empty(apk.pullRequests)) {
3635 text += '\n';
3636 text += '<b>Pull requests</b>: ' + toDisplayPullRequestList(apk);
3637 }
3638 return text;
3639}
3640
3641function processPublicCommand (botId, bot, msg, command, commandArgs) {
3642 if (msg.text) {

Callers 1

processPublicCommandFunction · 0.85

Calls 6

toDisplayAlgorithmFunction · 0.85
ucfirstFunction · 0.85
getDisplayVariantFunction · 0.85
toDisplayDateFunction · 0.85
emptyFunction · 0.85
toDisplayPullRequestListFunction · 0.85

Tested by

no test coverage detected