2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Fixes in floating dates with migrated histories.

All service messages are now not multiline (including pinned).
Confirmation for profile photo deleting will be added (not enabled).
Copy-by-selection should be supported in Linux version now.
Drafts that contain only reply-to-id (without text) support added.
This commit is contained in:
John Preston
2016-06-14 19:26:41 +03:00
parent 044e9221e8
commit 38c2915533
20 changed files with 182 additions and 120 deletions

View File

@@ -690,32 +690,10 @@ void MediaView::onForward() {
void MediaView::onDelete() {
close();
if (!_msgid) {
if (App::self() && _photo && App::self()->photoId == _photo->id) {
App::app()->peerClearPhoto(App::self()->id);
} else if (_user && _user == App::self()) {
for (int32 i = 0, l = _user->photos.size(); i != l; ++i) {
if (_user->photos.at(i) == _photo) {
_user->photos.removeAt(i);
MTP::send(MTPphotos_DeletePhotos(MTP_vector<MTPInputPhoto>(1, MTP_inputPhoto(MTP_long(_photo->id), MTP_long(_photo->access)))), rpcDone(&MediaView::deletePhotosDone), rpcFail(&MediaView::deletePhotosFail));
if (_user->photos.isEmpty()) {
hide();
} else if (i + 1 < l) {
showPhoto(_user->photos.at(i), _user);
} else {
showPhoto(_user->photos.at(i - 1), _user);
}
break;
}
}
} else if (_photo->peer && _photo->peer->photoId == _photo->id) {
App::app()->peerClearPhoto(_photo->peer->id);
}
} else {
HistoryItem *item = App::histItemById(_msgmigrated ? 0 : _channel, _msgid);
if (item) {
App::contextItem(item);
App::main()->deleteLayer();
}
App::main()->deletePhotoLayer(_photo);
} else if (auto item = App::histItemById(_msgmigrated ? 0 : _channel, _msgid)) {
App::contextItem(item);
App::main()->deleteLayer();
}
}
@@ -2186,15 +2164,6 @@ void MediaView::userPhotosLoaded(UserData *u, const MTPphotos_Photos &photos, mt
if (App::wnd()) App::wnd()->mediaOverviewUpdated(u, OverviewCount);
}
void MediaView::deletePhotosDone(const MTPVector<MTPlong> &result) {
}
bool MediaView::deletePhotosFail(const RPCError &error) {
if (MTP::isDefaultHandledError(error)) return false;
return true;
}
void MediaView::updateHeader() {
int32 index = _index, count = 0, addcount = (_migrated && _overview != OverviewCount) ? _migrated->overviewCount(_overview) : 0;
if (_history) {