Better difference between deleted and active accounts

For deleted users:
* Status changed to "account inaccessible"
* Ghost icon in dialogs list
* Status "account inacessible" shown even in block list
This commit is contained in:
Eric Kotato 2019-10-19 20:04:23 +03:00
parent 2351d710b9
commit ccc0054227
10 changed files with 23 additions and 4 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View file

@ -2315,4 +2315,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"ktg_manage_peer_subscribers" = "Subscribers";
"ktg_user_status_unaccessible" = "account inaccessible";
// Keys finished

View file

@ -78,5 +78,6 @@
"ktg_outdated_soon": "Иначе приложение перестанет обновляться с {date}.",
"ktg_outdated_now": "Чтобы приложение Kotatogram могло получать обновления.",
"ktg_mac_menu_show": "Показать Kotatogram",
"ktg_manage_peer_subscribers": "Подписчики"
"ktg_manage_peer_subscribers": "Подписчики",
"ktg_user_status_unaccessible": "аккаунт недоступен"
}

View file

@ -27,6 +27,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "storage/file_download.h"
#include "data/data_peer_values.h"
#include "data/data_chat.h"
#include "data/data_user.h"
#include "data/data_session.h"
#include "base/unixtime.h"
#include "window/themes/window_theme.h"
@ -381,6 +382,8 @@ void PeerListRow::refreshStatus() {
if (auto user = peer()->asUser()) {
if (_isSavedMessagesChat) {
setStatusText(tr::lng_saved_forward_here(tr::now));
} else if (user->isInaccessible()) {
setStatusText(tr::ktg_user_status_unaccessible(tr::now));
} else {
auto time = base::unixtime::now();
setStatusText(Data::OnlineText(user, time));

View file

@ -44,7 +44,9 @@ int OnlinePhraseChangeInSeconds(TimeId online, TimeId now) {
}
std::optional<QString> OnlineTextSpecial(not_null<UserData*> user) {
if (user->isNotificationsUser()) {
if (user->isInaccessible()) {
return tr::ktg_user_status_unaccessible(tr::now);
} else if (user->isNotificationsUser()) {
return tr::lng_status_service_notifications(tr::now);
} else if (user->isSupport()) {
return tr::lng_status_support(tr::now);

View file

@ -165,6 +165,9 @@ dialogsChannelIconActive: icon {{ "dialogs_channel", dialogsChatIconFgActive, po
dialogsBotIcon: icon {{ "dialogs_bot", dialogsChatIconFg, point(1px, 3px) }};
dialogsBotIconOver: icon {{ "dialogs_bot", dialogsChatIconFgOver, point(1px, 3px) }};
dialogsBotIconActive: icon {{ "dialogs_bot", dialogsChatIconFgActive, point(1px, 3px) }};
dialogsDeletedIcon: icon {{ "dialogs_deleted", dialogsChatIconFg, point(1px, 4px) }};
dialogsDeletedIconOver: icon {{ "dialogs_deleted", dialogsChatIconFgOver, point(1px, 4px) }};
dialogsDeletedIconActive: icon {{ "dialogs_deleted", dialogsChatIconFgActive, point(1px, 4px) }};
//dialogsFeedIcon: icon {{ "dialogs_feed", dialogsChatIconFg, point(4px, 4px) }}; // #feed
//dialogsFeedIconOver: icon {{ "dialogs_feed", dialogsChatIconFgOver, point(4px, 4px) }};
//dialogsFeedIconActive: icon {{ "dialogs_feed", dialogsChatIconFgActive, point(4px, 4px) }};

View file

@ -516,7 +516,13 @@ const style::icon *ChatTypeIcon(
? st::dialogsChannelIconOver
: st::dialogsChannelIcon));
} else if (const auto user = peer->asUser()) {
if (ShowUserBotIcon(user)) {
if (user->isInaccessible()) {
return &(active
? st::dialogsDeletedIconActive
: (selected
? st::dialogsDeletedIconOver
: st::dialogsDeletedIcon));
} else if (ShowUserBotIcon(user)) {
return &(active
? st::dialogsBotIconActive
: (selected

View file

@ -324,7 +324,9 @@ std::unique_ptr<PeerListRow> BlockedBoxController::createRow(
auto row = std::make_unique<PeerListRowWithLink>(user);
row->setActionLink(tr::lng_blocked_list_unblock(tr::now));
const auto status = [&] {
if (!user->phone().isEmpty()) {
if (user->isInaccessible()) {
return tr::ktg_user_status_unaccessible(tr::now);
} else if (!user->phone().isEmpty()) {
return App::formatPhone(user->phone());
} else if (!user->username.isEmpty()) {
return '@' + user->username;