Skip to content

Commit

Permalink
Merge pull request #635 from telegramdesktop/dev
Browse files Browse the repository at this point in the history
Create a new pull request by comparing changes across two branches
  • Loading branch information
GulajavaMinistudio authored Jul 25, 2023
2 parents 0a9c7fe + 642c5a3 commit d273006
Show file tree
Hide file tree
Showing 64 changed files with 1,180 additions and 343 deletions.
3 changes: 2 additions & 1 deletion Telegram/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1758,6 +1758,7 @@ endif()

if (LINUX AND DESKTOP_APP_USE_PACKAGED)
include(GNUInstallDirs)
configure_file("../lib/xdg/org.telegram.desktop.service" "${CMAKE_CURRENT_BINARY_DIR}/org.telegram.desktop.service" @ONLY)
configure_file("../lib/xdg/org.telegram.desktop.metainfo.xml" "${CMAKE_CURRENT_BINARY_DIR}/org.telegram.desktop.metainfo.xml" @ONLY)
generate_appdata_changelog(Telegram "${CMAKE_SOURCE_DIR}/changelog.txt" "${CMAKE_CURRENT_BINARY_DIR}/org.telegram.desktop.metainfo.xml")
install(TARGETS Telegram RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" BUNDLE DESTINATION "${CMAKE_INSTALL_BINDIR}")
Expand All @@ -1769,6 +1770,6 @@ if (LINUX AND DESKTOP_APP_USE_PACKAGED)
install(FILES "Resources/art/icon256.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps" RENAME "telegram.png")
install(FILES "Resources/art/icon512.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps" RENAME "telegram.png")
install(FILES "../lib/xdg/org.telegram.desktop.desktop" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
install(FILES "../lib/xdg/org.telegram.desktop.service" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/dbus-1/services")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.telegram.desktop.service" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/dbus-1/services")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.telegram.desktop.metainfo.xml" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo")
endif()
15 changes: 15 additions & 0 deletions Telegram/Resources/langs/lang.strings
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_profile_shared_links#other" = "{count} shared links";
"lng_profile_copy_phone" = "Copy Phone Number";
"lng_profile_copy_fullname" = "Copy Name";
"lng_profile_photo_by_you" = "photo set by you";
"lng_profile_public_photo" = "public photo";

"lng_via_link_group_one" = "**{user}** restricts adding them to groups.\nYou can send them an invite link as message instead.";
"lng_via_link_group_many#one" = "**{count} user** restricts adding them to groups.\nYou can send them an invite link as message instead.";
Expand Down Expand Up @@ -1710,6 +1712,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL

"lng_forwarded" = "Forwarded from {user}";
"lng_forwarded_story" = "Story from {user}";
"lng_forwarded_story_expired" = "This story has expired.";
"lng_forwarded_date" = "Original: {date}";
"lng_forwarded_channel" = "Forwarded from {channel}";
"lng_forwarded_psa_default" = "Forwarded from {channel}";
Expand Down Expand Up @@ -3832,6 +3835,18 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_stories_no_views" = "No views";
"lng_stories_unsupported" = "This story is not supported\nby your version of Telegram.";
"lng_stories_cant_reply" = "You can't reply to this story.";
"lng_stories_about_silent" = "This video has no sound.";
"lng_stories_about_close_friends" = "You're seeing this story because {user} added you to their list of **Close Friends**.";
"lng_stories_about_contacts" = "Only {user}'s contacts can view this story.";
"lng_stories_about_selected_contacts" = "Only some contacts {user} selected can view this story.";
"lng_stories_about_close_friends_my" = "Only your list of **Close Friends** can view this story.";
"lng_stories_about_contacts_my" = "Only your contacts can view this story.";
"lng_stories_about_selected_contacts_my" = "Only some contacts you selected can view this story.";
"lng_stories_click_to_view_mine" = "Click here to view your story.";
"lng_stories_click_to_view" = "Click here to view updates from {users}.";
"lng_stories_click_to_view_and_one" = "{accumulated}, {user}";
"lng_stories_click_to_view_and_last" = "{accumulated} and {user}";
"lng_stories_show_more" = "Show more";

"lng_stories_my_title" = "Saved Stories";
"lng_stories_archive_button" = "Stories Archive";
Expand Down
2 changes: 1 addition & 1 deletion Telegram/Resources/uwp/AppX/AppxManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Identity Name="TelegramMessengerLLP.TelegramDesktop"
ProcessorArchitecture="ARCHITECTURE"
Publisher="CN=536BC709-8EE1-4478-AF22-F0F0F26FF64A"
Version="4.8.7.0" />
Version="4.8.8.0" />
<Properties>
<DisplayName>Telegram Desktop</DisplayName>
<PublisherDisplayName>Telegram Messenger LLP</PublisherDisplayName>
Expand Down
8 changes: 4 additions & 4 deletions Telegram/Resources/winrc/Telegram.rc
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico"
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,8,7,0
PRODUCTVERSION 4,8,7,0
FILEVERSION 4,8,8,0
PRODUCTVERSION 4,8,8,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -62,10 +62,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Telegram FZ-LLC"
VALUE "FileDescription", "Telegram Desktop"
VALUE "FileVersion", "4.8.7.0"
VALUE "FileVersion", "4.8.8.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2023"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "4.8.7.0"
VALUE "ProductVersion", "4.8.8.0"
END
END
BLOCK "VarFileInfo"
Expand Down
8 changes: 4 additions & 4 deletions Telegram/Resources/winrc/Updater.rc
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,8,7,0
PRODUCTVERSION 4,8,7,0
FILEVERSION 4,8,8,0
PRODUCTVERSION 4,8,8,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -53,10 +53,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Telegram FZ-LLC"
VALUE "FileDescription", "Telegram Desktop Updater"
VALUE "FileVersion", "4.8.7.0"
VALUE "FileVersion", "4.8.8.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2023"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "4.8.7.0"
VALUE "ProductVersion", "4.8.8.0"
END
END
BLOCK "VarFileInfo"
Expand Down
7 changes: 4 additions & 3 deletions Telegram/SourceFiles/boxes/gift_premium_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,15 @@ void GiftBox(

// List.
const auto group = std::make_shared<Ui::RadiobuttonGroup>();
group->setChangedCallback([=](int value) {
const auto groupValueChangedCallback = [=](int value) {
Expects(value < options.size() && value >= 0);
auto text = tr::lng_premium_gift_button(
tr::now,
lt_cost,
options[value].costTotal);
state->buttonText.fire(std::move(text));
});
};
group->setChangedCallback(groupValueChangedCallback);
Ui::Premium::AddGiftOptions(
buttonsParent,
group,
Expand Down Expand Up @@ -215,7 +216,7 @@ void GiftBox(
});
box->addButton(std::move(button));

group->setValue(0);
groupValueChangedCallback(0);

Data::PeerPremiumValue(
user
Expand Down
67 changes: 51 additions & 16 deletions Telegram/SourceFiles/boxes/peers/peer_short_info_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ PeerShortInfoCover::PeerShortInfoCover(
userpic
) | rpl::start_with_next([=](PeerShortInfoUserpic &&value) {
applyUserpic(std::move(value));
applyAdditionalStatus(value.additionalStatus);
}, lifetime());

style::PaletteChanged(
Expand Down Expand Up @@ -136,16 +137,7 @@ PeerShortInfoCover::PeerShortInfoCover(
return base::EventFilterResult::Cancel;
});

_name->moveToLeft(
_st.namePosition.x(),
_st.size - _st.namePosition.y() - _name->height(),
_st.size);
_status->moveToLeft(
_st.statusPosition.x(),
(_st.size
- _st.statusPosition.y()
- _status->height()),
_st.size);
refreshLabelsGeometry();

_roundedTopImage = QImage(
QSize(_st.size, _st.radius) * style::DevicePixelRatio(),
Expand Down Expand Up @@ -415,6 +407,23 @@ QImage PeerShortInfoCover::currentVideoFrame() const {
: QImage();
}

void PeerShortInfoCover::applyAdditionalStatus(const QString &status) {
if (status.isEmpty()) {
if (_additionalStatus) {
_additionalStatus.destroy();
refreshLabelsGeometry();
}
return;
}
if (_additionalStatus) {
_additionalStatus->setText(status);
} else {
_additionalStatus.create(_widget.get(), status, _statusStyle->st);
_additionalStatus->show();
refreshLabelsGeometry();
}
}

void PeerShortInfoCover::applyUserpic(PeerShortInfoUserpic &&value) {
if (_index != value.index) {
_index = value.index;
Expand Down Expand Up @@ -593,6 +602,28 @@ void PeerShortInfoCover::refreshBarImages() {
_barLarge = makeBar(_largeWidth);
}

void PeerShortInfoCover::refreshLabelsGeometry() {
const auto statusTop = _st.size
- _st.statusPosition.y()
- _status->height();
const auto diff = _st.namePosition.y()
- _name->height()
- _st.statusPosition.y();
if (_additionalStatus) {
_additionalStatus->moveToLeft(
_status->x(),
statusTop - diff - _additionalStatus->height());
}
_name->moveToLeft(
_st.namePosition.x(),
_st.size
- _st.namePosition.y()
- _name->height()
- (_additionalStatus ? (diff + _additionalStatus->height()) : 0),
_st.size);
_status->moveToLeft(_st.statusPosition.x(), statusTop, _st.size);
}

QRect PeerShortInfoCover::radialRect() const {
const auto cover = _widget->rect();
const auto size = st::boxLoadingSize;
Expand Down Expand Up @@ -654,12 +685,16 @@ rpl::producer<int> PeerShortInfoBox::moveRequests() const {
void PeerShortInfoBox::prepare() {
addButton(tr::lng_close(), [=] { closeBox(); });

// Perhaps a new lang key should be added for opening a group.
addLeftButton((_type == PeerShortInfoType::User)
? tr::lng_profile_send_message()
: (_type == PeerShortInfoType::Group)
? tr::lng_view_button_group()
: tr::lng_profile_view_channel(), [=] { _openRequests.fire({}); });
if (_type != PeerShortInfoType::Self) {
// Perhaps a new lang key should be added for opening a group.
addLeftButton(
(_type == PeerShortInfoType::User)
? tr::lng_profile_send_message()
: (_type == PeerShortInfoType::Group)
? tr::lng_view_button_group()
: tr::lng_profile_view_channel(),
[=] { _openRequests.fire({}); });
}

prepareRows();

Expand Down
5 changes: 5 additions & 0 deletions Telegram/SourceFiles/boxes/peers/peer_short_info_box.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class RpWidget;
} // namespace Ui

enum class PeerShortInfoType {
Self,
User,
Group,
Channel,
Expand All @@ -50,6 +51,7 @@ struct PeerShortInfoUserpic {
float64 photoLoadingProgress = 0.;
std::shared_ptr<Media::Streaming::Document> videoDocument;
crl::time videoStartPosition = 0;
QString additionalStatus;
};

class PeerShortInfoCover final {
Expand Down Expand Up @@ -87,6 +89,7 @@ class PeerShortInfoCover final {
[[nodiscard]] QImage currentVideoFrame() const;

void applyUserpic(PeerShortInfoUserpic &&value);
void applyAdditionalStatus(const QString &status);
[[nodiscard]] QRect radialRect() const;

void videoWaiting();
Expand All @@ -99,6 +102,7 @@ class PeerShortInfoCover final {
void updateRadialState();
void refreshCoverCursor();
void refreshBarImages();
void refreshLabelsGeometry();

const style::ShortInfoCover &_st;

Expand All @@ -108,6 +112,7 @@ class PeerShortInfoCover final {
object_ptr<Ui::FlatLabel> _name;
std::unique_ptr<CustomLabelStyle> _statusStyle;
object_ptr<Ui::FlatLabel> _status;
object_ptr<Ui::FlatLabel> _additionalStatus = { nullptr };

std::array<QImage, 4> _roundMask;
QImage _userpicImage;
Expand Down
13 changes: 12 additions & 1 deletion Telegram/SourceFiles/boxes/peers/prepare_short_info_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,15 @@ bool ProcessCurrent(
: state->photoView
? state->photoView->owner().get()
: nullptr;
state->current.additionalStatus = (!peer->isUser())
? QString()
: ((state->photoId == userpicPhotoId)
&& peer->asUser()->hasPersonalPhoto())
? tr::lng_profile_photo_by_you(tr::now)
: ((state->current.index == (state->current.count - 1))
&& SyncUserFallbackPhotoViewer(peer->asUser()))
? tr::lng_profile_public_photo(tr::now)
: QString();
state->waitingLoad = false;
if (!changedPhotoId
&& (state->current.index > 0 || !changedUserpic)
Expand Down Expand Up @@ -422,7 +431,9 @@ object_ptr<Ui::BoxContent> PrepareShortInfoBox(
Fn<void()> open,
Fn<bool()> videoPaused,
const style::ShortInfoBox *stOverride) {
const auto type = peer->isUser()
const auto type = peer->isSelf()
? PeerShortInfoType::Self
: peer->isUser()
? PeerShortInfoType::User
: peer->isBroadcast()
? PeerShortInfoType::Channel
Expand Down
13 changes: 6 additions & 7 deletions Telegram/SourceFiles/calls/calls.style
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,11 @@ groupCallShareBoxComment: InputField(groupCallField) {
}
groupCallShareBoxList: PeerList(groupCallMembersList) {
item: PeerListItem(groupCallMembersListItem) {
nameStyle: TextStyle(defaultTextStyle) {
font: font(11px);
linkFont: font(11px);
linkFontOver: font(11px);
}
checkbox: RoundImageCheckbox(groupCallMembersListCheckbox) {
imageRadius: 28px;
imageSmallRadius: 24px;
Expand Down Expand Up @@ -1333,13 +1338,7 @@ groupCallNiceTooltip: ImportantTooltip(defaultImportantTooltip) {
radius: 4px;
arrow: 4px;
}
groupCallNiceTooltipLabel: FlatLabel(defaultImportantTooltipLabel) {
style: TextStyle(defaultTextStyle) {
font: font(11px);
linkFont: font(11px);
linkFontOver: font(11px underline);
}
}
groupCallNiceTooltipLabel: defaultImportantTooltipLabel;
groupCallStickedTooltip: ImportantTooltip(groupCallNiceTooltip) {
padding: margins(10px, 1px, 6px, 3px);
}
Expand Down
2 changes: 2 additions & 0 deletions Telegram/SourceFiles/chat_helpers/chat_helpers.style
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ ComposeControls {
record: RecordBar;
files: ComposeFiles;
premium: PremiumLimits;
boxField: InputField;
}

ReportBox {
Expand Down Expand Up @@ -1148,6 +1149,7 @@ defaultComposeControls: ComposeControls {
record: defaultRecordBar;
files: defaultComposeFiles;
premium: defaultPremiumLimits;
boxField: defaultInputField;
}

moreChatsBarHeight: 48px;
Expand Down
1 change: 1 addition & 0 deletions Telegram/SourceFiles/core/click_handler_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ void HiddenUrlClickHandler::Open(QString url, QVariant context) {
my.show->showBox(std::move(box));
} else if (use) {
use->show(std::move(box));
use->activate();
}
} else {
open();
Expand Down
Loading

0 comments on commit d273006

Please sign in to comment.