2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-01 15:15:13 +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

@@ -630,6 +630,36 @@ void MainWidget::deleteLayer(int32 selectedCount) {
Ui::showLayer(box);
}
void MainWidget::deletePhotoLayer(PhotoData *photo) {
_deletingPhoto = photo;
onDeletePhotoSure(); // langs are not ready yet
//auto box = new ConfirmBox(lang(lng_delete_photo_sure), lang(lng_box_delete));
//connect(box, SIGNAL(confirmed()), this, SLOT(onDeletePhotoSure()));
//Ui::showLayer(box);
}
void MainWidget::onDeletePhotoSure() {
Ui::hideLayer();
auto me = App::self();
auto photo = _deletingPhoto;
if (!photo || !me) return;
if (me->photoId == photo->id) {
App::app()->peerClearPhoto(me->id);
} else if (photo->peer && !photo->peer->isUser() && photo->peer->photoId == photo->id) {
App::app()->peerClearPhoto(photo->peer->id);
} else {
for (int i = 0, l = me->photos.size(); i != l; ++i) {
if (me->photos.at(i) == photo) {
me->photos.removeAt(i);
MTP::send(MTPphotos_DeletePhotos(MTP_vector<MTPInputPhoto>(1, MTP_inputPhoto(MTP_long(photo->id), MTP_long(photo->access)))));
break;
}
}
}
}
void MainWidget::shareContactLayer(UserData *contact) {
hiderLayer(new HistoryHider(this, contact));
}
@@ -1680,9 +1710,7 @@ void MainWidget::updateOnlineDisplay() {
}
void MainWidget::onSendFileConfirm(const FileLoadResultPtr &file, bool ctrlShiftEnter) {
bool lastKeyboardUsed = _history->lastForceReplyReplied(FullMsgId(peerToChannel(file->to.peer), file->to.replyTo));
_history->confirmSendFile(file, ctrlShiftEnter);
_history->cancelReply(lastKeyboardUsed);
}
void MainWidget::onSendFileCancel(const FileLoadResultPtr &file) {