Making showing chat IDs optional
This commit is contained in:
parent
4cd61812f9
commit
3d2ae1a844
5 changed files with 40 additions and 27 deletions
|
|
@ -10,5 +10,6 @@
|
||||||
// },
|
// },
|
||||||
// "sticker_height": 256,
|
// "sticker_height": 256,
|
||||||
// "big_emoji_outline": true,
|
// "big_emoji_outline": true,
|
||||||
// "always_show_scheduled": false
|
// "always_show_scheduled": false,
|
||||||
|
// "show_chat_id": false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -172,6 +172,11 @@ bool Manager::readCustomFile() {
|
||||||
if (settingsAlwaysShowScheduledIterator != settingsFonts.constEnd() && (*settingsAlwaysShowScheduledIterator).isBool()) {
|
if (settingsAlwaysShowScheduledIterator != settingsFonts.constEnd() && (*settingsAlwaysShowScheduledIterator).isBool()) {
|
||||||
cSetAlwaysShowScheduled((*settingsAlwaysShowScheduledIterator).toBool());
|
cSetAlwaysShowScheduled((*settingsAlwaysShowScheduledIterator).toBool());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto settingsShowChatIdIterator = settings.constFind(qsl("show_chat_id"));
|
||||||
|
if (settingsShowChatIdIterator != settingsFonts.constEnd() && (*settingsShowChatIdIterator).isBool()) {
|
||||||
|
cSetShowChatId((*settingsShowChatIdIterator).toBool());
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -202,6 +207,7 @@ void Manager::writeDefaultFile() {
|
||||||
settings.insert(qsl("sticker_height"), cStickerHeight());
|
settings.insert(qsl("sticker_height"), cStickerHeight());
|
||||||
settings.insert(qsl("big_emoji_outline"), cBigEmojiOutline());
|
settings.insert(qsl("big_emoji_outline"), cBigEmojiOutline());
|
||||||
settings.insert(qsl("always_show_scheduled"), cAlwaysShowScheduled());
|
settings.insert(qsl("always_show_scheduled"), cAlwaysShowScheduled());
|
||||||
|
settings.insert(qsl("show_chat_id"), cShowChatId());
|
||||||
|
|
||||||
auto document = QJsonDocument();
|
auto document = QJsonDocument();
|
||||||
document.setObject(settings);
|
document.setObject(settings);
|
||||||
|
|
|
||||||
|
|
@ -255,16 +255,18 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
if (const auto user = _peer->asUser()) {
|
if (const auto user = _peer->asUser()) {
|
||||||
if (user->isBot()) {
|
if (cShowChatId()) {
|
||||||
addInfoOneLine(
|
if (user->isBot()) {
|
||||||
tr::ktg_profile_bot_id(),
|
addInfoOneLine(
|
||||||
IDValue(user),
|
tr::ktg_profile_bot_id(),
|
||||||
tr::ktg_profile_copy_id(tr::now));
|
IDValue(user),
|
||||||
} else {
|
tr::ktg_profile_copy_id(tr::now));
|
||||||
addInfoOneLine(
|
} else {
|
||||||
tr::ktg_profile_user_id(),
|
addInfoOneLine(
|
||||||
IDValue(user),
|
tr::ktg_profile_user_id(),
|
||||||
tr::ktg_profile_copy_id(tr::now));
|
IDValue(user),
|
||||||
|
tr::ktg_profile_copy_id(tr::now));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (user->session().supportMode()) {
|
if (user->session().supportMode()) {
|
||||||
|
|
@ -295,21 +297,23 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
|
||||||
[=] { window->show(Box(EditContactBox, window, user)); },
|
[=] { window->show(Box(EditContactBox, window, user)); },
|
||||||
tracker);
|
tracker);
|
||||||
} else {
|
} else {
|
||||||
if (_peer->isChat()) {
|
if (cShowChatId()) {
|
||||||
addInfoOneLine(
|
if (_peer->isChat()) {
|
||||||
tr::ktg_profile_group_id(),
|
addInfoOneLine(
|
||||||
IDValue(_peer),
|
tr::ktg_profile_group_id(),
|
||||||
tr::ktg_profile_copy_id(tr::now));
|
IDValue(_peer),
|
||||||
} else if (_peer->isMegagroup()) {
|
tr::ktg_profile_copy_id(tr::now));
|
||||||
addInfoOneLine(
|
} else if (_peer->isMegagroup()) {
|
||||||
tr::ktg_profile_supergroup_id(),
|
addInfoOneLine(
|
||||||
IDValue(_peer),
|
tr::ktg_profile_supergroup_id(),
|
||||||
tr::ktg_profile_copy_id(tr::now));
|
IDValue(_peer),
|
||||||
} else {
|
tr::ktg_profile_copy_id(tr::now));
|
||||||
addInfoOneLine(
|
} else {
|
||||||
tr::ktg_profile_channel_id(),
|
addInfoOneLine(
|
||||||
IDValue(_peer),
|
tr::ktg_profile_channel_id(),
|
||||||
tr::ktg_profile_copy_id(tr::now));
|
IDValue(_peer),
|
||||||
|
tr::ktg_profile_copy_id(tr::now));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto linkText = LinkValue(
|
auto linkText = LinkValue(
|
||||||
|
|
|
||||||
|
|
@ -213,3 +213,4 @@ bool gSemiboldFontIsBold = false;
|
||||||
int gStickerHeight = 256;
|
int gStickerHeight = 256;
|
||||||
bool gBigEmojiOutline = true;
|
bool gBigEmojiOutline = true;
|
||||||
bool gAlwaysShowScheduled = false;
|
bool gAlwaysShowScheduled = false;
|
||||||
|
bool gShowChatId = false;
|
||||||
|
|
|
||||||
|
|
@ -187,3 +187,4 @@ DeclareSetting(QString, MonospaceFont);
|
||||||
DeclareSetting(int, StickerHeight);
|
DeclareSetting(int, StickerHeight);
|
||||||
DeclareSetting(bool, BigEmojiOutline);
|
DeclareSetting(bool, BigEmojiOutline);
|
||||||
DeclareSetting(bool, AlwaysShowScheduled);
|
DeclareSetting(bool, AlwaysShowScheduled);
|
||||||
|
DeclareSetting(bool, ShowChatId);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue