Skip to content

Commit

Permalink
Updated to 4.16.
Browse files Browse the repository at this point in the history
  • Loading branch information
23rd committed Apr 1, 2024
2 parents 22f987a + 707146d commit c79cad6
Show file tree
Hide file tree
Showing 323 changed files with 10,867 additions and 2,094 deletions.
34 changes: 24 additions & 10 deletions Telegram/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ PRIVATE
api/api_chat_filters.h
api/api_chat_invite.cpp
api/api_chat_invite.h
api/api_chat_links.cpp
api/api_chat_links.h
api/api_chat_participants.cpp
api/api_chat_participants.h
api/api_cloud_password.cpp
Expand All @@ -122,6 +124,8 @@ PRIVATE
api/api_common.h
api/api_confirm_phone.cpp
api/api_confirm_phone.h
api/api_earn.cpp
api/api_earn.h
api/api_editing.cpp
api/api_editing.h
api/api_global_privacy.cpp
Expand Down Expand Up @@ -726,6 +730,8 @@ PRIVATE
history/view/media/history_view_media.h
history/view/media/history_view_media_common.cpp
history/view/media/history_view_media_common.h
history/view/media/history_view_media_generic.cpp
history/view/media/history_view_media_generic.h
history/view/media/history_view_media_grouped.cpp
history/view/media/history_view_media_grouped.h
history/view/media/history_view_media_spoiler.cpp
Expand Down Expand Up @@ -867,14 +873,18 @@ PRIVATE
history/history_view_highlight_manager.h
history/history_widget.cpp
history/history_widget.h
info/boosts/giveaway/giveaway_list_controllers.cpp
info/boosts/giveaway/giveaway_list_controllers.h
info/boosts/create_giveaway_box.cpp
info/boosts/create_giveaway_box.h
info/boosts/info_boosts_inner_widget.cpp
info/boosts/info_boosts_inner_widget.h
info/boosts/info_boosts_widget.cpp
info/boosts/info_boosts_widget.h
info/channel_statistics/boosts/create_giveaway_box.cpp
info/channel_statistics/boosts/create_giveaway_box.h
info/channel_statistics/boosts/giveaway/giveaway_list_controllers.cpp
info/channel_statistics/boosts/giveaway/giveaway_list_controllers.h
info/channel_statistics/boosts/info_boosts_inner_widget.cpp
info/channel_statistics/boosts/info_boosts_inner_widget.h
info/channel_statistics/boosts/info_boosts_widget.cpp
info/channel_statistics/boosts/info_boosts_widget.h
info/channel_statistics/earn/info_earn_inner_widget.cpp
info/channel_statistics/earn/info_earn_inner_widget.h
info/channel_statistics/earn/info_earn_widget.cpp
info/channel_statistics/earn/info_earn_widget.h
info/common_groups/info_common_groups_inner_widget.cpp
info/common_groups/info_common_groups_inner_widget.h
info/common_groups/info_common_groups_widget.cpp
Expand Down Expand Up @@ -1143,6 +1153,8 @@ PRIVATE
menu/menu_mute.h
menu/menu_send.cpp
menu/menu_send.h
menu/menu_sponsored.cpp
menu/menu_sponsored.h
menu/menu_ttl_validator.cpp
menu/menu_ttl_validator.h
mtproto/config_loader.cpp
Expand Down Expand Up @@ -1197,8 +1209,6 @@ PRIVATE
payments/payments_checkout_process.h
payments/payments_form.cpp
payments/payments_form.h
platform/linux/linux_desktop_environment.cpp
platform/linux/linux_desktop_environment.h
platform/linux/linux_wayland_integration_dummy.cpp
platform/linux/linux_wayland_integration.cpp
platform/linux/linux_wayland_integration.h
Expand Down Expand Up @@ -1305,6 +1315,10 @@ PRIVATE
settings/business/settings_away_message.h
settings/business/settings_shortcut_messages.cpp
settings/business/settings_shortcut_messages.h
settings/business/settings_chat_intro.cpp
settings/business/settings_chat_intro.h
settings/business/settings_chat_links.cpp
settings/business/settings_chat_links.h
settings/business/settings_chatbots.cpp
settings/business/settings_chatbots.h
settings/business/settings_greeting.cpp
Expand Down
Binary file added Telegram/Resources/animations/chat_link.tgs
Binary file not shown.
Binary file added Telegram/Resources/icons/filled_go_to_message.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Telegram/Resources/icons/menu/earn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Telegram/Resources/icons/menu/earn@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Telegram/Resources/icons/menu/earn@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Telegram/Resources/icons/sponsored/channel.png
Binary file added Telegram/Resources/icons/sponsored/channel@2x.png
Binary file added Telegram/Resources/icons/sponsored/channel@3x.png
Binary file added Telegram/Resources/icons/sponsored/large_earn.png
Binary file added Telegram/Resources/icons/sponsored/privacy_about.png
Binary file added Telegram/Resources/icons/sponsored/remove_about.png
Binary file added Telegram/Resources/icons/sponsored/revenue_split.png
Binary file added Telegram/Resources/icons/sponsored/withdrawals.png
2 changes: 1 addition & 1 deletion Telegram/Resources/iv_html/page.css
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ figure.slideshow .video-wrap {
bottom: 10px;
white-space: nowrap;
overflow: hidden;
z-index: 3;
z-index: 5;
}
.slideshow-buttons > fieldset {
padding: 0;
Expand Down
1 change: 0 additions & 1 deletion Telegram/Resources/iv_html/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ var IV = {
var s = form.s;
const next = +s.value + delta;
s.value = (next == s.length) ? 0 : (next == -1) ? (s.length - 1) : next;
s.forEach(function(el){ el.checked && el.parentNode.scrollIntoView && el.parentNode.scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'}); });
form.nextSibling.firstChild.style[marginProp] = (-100 * s.value) + '%';
} else {
el.form.nextSibling.firstChild.style[marginProp] = (-100 * el.value) + '%';
Expand Down
191 changes: 191 additions & 0 deletions Telegram/Resources/langs/lang.strings

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Telegram/Resources/qrc/telegram/animations.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
<file alias="writing.tgs">../../animations/writing.tgs</file>
<file alias="hours.tgs">../../animations/hours.tgs</file>
<file alias="phone.tgs">../../animations/phone.tgs</file>
<file alias="chat_link.tgs">../../animations/chat_link.tgs</file>
</qresource>
</RCC>
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.15.6.0" />
Version="4.16.0.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,15,6,0
PRODUCTVERSION 4,15,6,0
FILEVERSION 4,16,0,0
PRODUCTVERSION 4,16,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -62,10 +62,10 @@ BEGIN
BEGIN
VALUE "CompanyName", ""
VALUE "FileDescription", "Telegram Desktop"
VALUE "FileVersion", "4.15.6.0"
VALUE "FileVersion", "4.16.0.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2024"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "4.15.6.0"
VALUE "ProductVersion", "4.16.0.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,15,6,0
PRODUCTVERSION 4,15,6,0
FILEVERSION 4,16,0,0
PRODUCTVERSION 4,16,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -53,10 +53,10 @@ BEGIN
BEGIN
VALUE "CompanyName", ""
VALUE "FileDescription", "Telegram Desktop Updater"
VALUE "FileVersion", "4.15.6.0"
VALUE "FileVersion", "4.16.0.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2024"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "4.15.6.0"
VALUE "ProductVersion", "4.16.0.0"
END
END
BLOCK "VarFileInfo"
Expand Down
170 changes: 170 additions & 0 deletions Telegram/SourceFiles/api/api_chat_links.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "api/api_chat_links.h"

#include "api/api_text_entities.h"
#include "apiwrap.h"
#include "data/data_session.h"
#include "main/main_session.h"

namespace Api {
namespace {

[[nodiscard]] ChatLink FromMTP(
not_null<Main::Session*> session,
const MTPBusinessChatLink &link) {
const auto &data = link.data();
return {
.link = qs(data.vlink()),
.title = qs(data.vtitle().value_or_empty()),
.message = {
qs(data.vmessage()),
EntitiesFromMTP(
session,
data.ventities().value_or_empty())
},
.clicks = data.vviews().v,
};
}

[[nodiscard]] MTPInputBusinessChatLink ToMTP(
not_null<Main::Session*> session,
const QString &title,
const TextWithEntities &message) {
auto entities = EntitiesToMTP(
session,
message.entities,
ConvertOption::SkipLocal);
using Flag = MTPDinputBusinessChatLink::Flag;
const auto flags = (title.isEmpty() ? Flag() : Flag::f_title)
| (entities.v.isEmpty() ? Flag() : Flag::f_entities);
return MTP_inputBusinessChatLink(
MTP_flags(flags),
MTP_string(message.text),
std::move(entities),
MTP_string(title));
}

} // namespace

ChatLinks::ChatLinks(not_null<ApiWrap*> api) : _api(api) {
}

void ChatLinks::create(
const QString &title,
const TextWithEntities &message,
Fn<void(Link)> done) {
const auto session = &_api->session();
_api->request(MTPaccount_CreateBusinessChatLink(
ToMTP(session, title, message)
)).done([=](const MTPBusinessChatLink &result) {
const auto link = FromMTP(session, result);
_list.push_back(link);
_updates.fire({ .was = QString(), .now = link });
if (done) done(link);
}).fail([=](const MTP::Error &error) {
const auto type = error.type();
if (done) done(Link());
}).send();
}

void ChatLinks::edit(
const QString &link,
const QString &title,
const TextWithEntities &message,
Fn<void(Link)> done) {
const auto session = &_api->session();
_api->request(MTPaccount_EditBusinessChatLink(
MTP_string(link),
ToMTP(session, title, message)
)).done([=](const MTPBusinessChatLink &result) {
const auto parsed = FromMTP(session, result);
if (parsed.link != link) {
LOG(("API Error: EditBusinessChatLink changed the link."));
if (done) done(Link());
return;
}
const auto i = ranges::find(_list, link, &Link::link);
if (i != end(_list)) {
*i = parsed;
_updates.fire({ .was = link, .now = parsed });
if (done) done(parsed);
} else {
LOG(("API Error: EditBusinessChatLink link not found."));
if (done) done(Link());
}
}).fail([=](const MTP::Error &error) {
const auto type = error.type();
if (done) done(Link());
}).send();
}

void ChatLinks::destroy(
const QString &link,
Fn<void()> done) {
_api->request(MTPaccount_DeleteBusinessChatLink(
MTP_string(link)
)).done([=] {
const auto i = ranges::find(_list, link, &Link::link);
if (i != end(_list)) {
_list.erase(i);
_updates.fire({ .was = link });
if (done) done();
} else {
LOG(("API Error: DeleteBusinessChatLink link not found."));
if (done) done();
}
}).fail([=](const MTP::Error &error) {
const auto type = error.type();
if (done) done();
}).send();
}

void ChatLinks::preload() {
if (_loaded || _requestId) {
return;
}
_requestId = _api->request(MTPaccount_GetBusinessChatLinks(
)).done([=](const MTPaccount_BusinessChatLinks &result) {
const auto &data = result.data();
const auto session = &_api->session();
const auto owner = &session->data();
owner->processUsers(data.vusers());
owner->processChats(data.vchats());
auto links = std::vector<Link>();
links.reserve(data.vlinks().v.size());
for (const auto &link : data.vlinks().v) {
links.push_back(FromMTP(session, link));
}
_list = std::move(links);
_loaded = true;
_loadedUpdates.fire({});
}).fail([=] {
_requestId = 0;
_loaded = true;
_loadedUpdates.fire({});
}).send();
}

const std::vector<ChatLink> &ChatLinks::list() const {
return _list;
}

bool ChatLinks::loaded() const {
return _loaded;
}

rpl::producer<> ChatLinks::loadedUpdates() const {
return _loadedUpdates.events();
}

rpl::producer<ChatLinks::Update> ChatLinks::updates() const {
return _updates.events();
}

} // namespace Api
64 changes: 64 additions & 0 deletions Telegram/SourceFiles/api/api_chat_links.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once

class ApiWrap;

namespace Api {

struct ChatLink {
QString link;
QString title;
TextWithEntities message;
int clicks = 0;
};

struct ChatLinkUpdate {
QString was;
std::optional<ChatLink> now;
};

class ChatLinks final {
public:
explicit ChatLinks(not_null<ApiWrap*> api);

using Link = ChatLink;
using Update = ChatLinkUpdate;

void create(
const QString &title,
const TextWithEntities &message,
Fn<void(Link)> done = nullptr);
void edit(
const QString &link,
const QString &title,
const TextWithEntities &message,
Fn<void(Link)> done = nullptr);
void destroy(
const QString &link,
Fn<void()> done = nullptr);

void preload();
[[nodiscard]] const std::vector<ChatLink> &list() const;
[[nodiscard]] bool loaded() const;
[[nodiscard]] rpl::producer<> loadedUpdates() const;
[[nodiscard]] rpl::producer<Update> updates() const;

private:
const not_null<ApiWrap*> _api;

std::vector<Link> _list;
rpl::event_stream<> _loadedUpdates;
mtpRequestId _requestId = 0;
bool _loaded = false;

rpl::event_stream<Update> _updates;

};

} // namespace Api
Loading

0 comments on commit c79cad6

Please sign in to comment.