mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
feat(UI): Add UI for removing group history
This commit is contained in:
parent
1142cc03f8
commit
cd3c7b392e
|
@ -1744,16 +1744,7 @@ void Widget::removeFriend(Friend* f, bool fake)
|
|||
{
|
||||
assert(f);
|
||||
if (!fake) {
|
||||
RemoveChatDialog ask(this, *f);
|
||||
ask.exec();
|
||||
|
||||
if (!ask.accepted()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ask.removeHistory()) {
|
||||
profile.getHistory()->removeFriendHistory(f->getPublicKey());
|
||||
}
|
||||
removeChatHistory(*f);
|
||||
}
|
||||
|
||||
const ToxPk friendPk = f->getPublicKey();
|
||||
|
@ -2059,6 +2050,11 @@ void Widget::onGroupPeerAudioPlaying(int groupnumber, ToxPk peerPk)
|
|||
|
||||
void Widget::removeGroup(Group* g, bool fake)
|
||||
{
|
||||
assert(g);
|
||||
if (!fake) {
|
||||
removeChatHistory(*g);
|
||||
}
|
||||
|
||||
const auto& groupId = g->getPersistentId();
|
||||
const auto groupnumber = g->getId();
|
||||
auto groupWidgetIt = groupWidgets.find(groupId);
|
||||
|
@ -2742,3 +2738,17 @@ void Widget::formatWindowTitle(const QString& content)
|
|||
setWindowTitle(content + " - qTox");
|
||||
}
|
||||
}
|
||||
|
||||
void Widget::removeChatHistory(Chat& chat)
|
||||
{
|
||||
RemoveChatDialog ask(this, chat);
|
||||
ask.exec();
|
||||
|
||||
if (!ask.accepted()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ask.removeHistory()) {
|
||||
profile.getHistory()->removeChatHistory(chat.getPersistentId());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -287,6 +287,7 @@ private:
|
|||
void cleanupNotificationSound();
|
||||
void acceptFileTransfer(const ToxFile &file, const QString &path);
|
||||
void formatWindowTitle(const QString& content);
|
||||
void removeChatHistory(Chat& chat);
|
||||
|
||||
private:
|
||||
Profile& profile;
|
||||
|
|
Loading…
Reference in New Issue
Block a user