|
|
@ -1744,16 +1744,7 @@ void Widget::removeFriend(Friend* f, bool fake) |
|
|
|
{ |
|
|
|
{ |
|
|
|
assert(f); |
|
|
|
assert(f); |
|
|
|
if (!fake) { |
|
|
|
if (!fake) { |
|
|
|
RemoveChatDialog ask(this, *f); |
|
|
|
removeChatHistory(*f); |
|
|
|
ask.exec(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!ask.accepted()) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ask.removeHistory()) { |
|
|
|
|
|
|
|
profile.getHistory()->removeFriendHistory(f->getPublicKey()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const ToxPk friendPk = f->getPublicKey(); |
|
|
|
const ToxPk friendPk = f->getPublicKey(); |
|
|
@ -2059,6 +2050,11 @@ void Widget::onGroupPeerAudioPlaying(int groupnumber, ToxPk peerPk) |
|
|
|
|
|
|
|
|
|
|
|
void Widget::removeGroup(Group* g, bool fake) |
|
|
|
void Widget::removeGroup(Group* g, bool fake) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
assert(g); |
|
|
|
|
|
|
|
if (!fake) { |
|
|
|
|
|
|
|
removeChatHistory(*g); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const auto& groupId = g->getPersistentId(); |
|
|
|
const auto& groupId = g->getPersistentId(); |
|
|
|
const auto groupnumber = g->getId(); |
|
|
|
const auto groupnumber = g->getId(); |
|
|
|
auto groupWidgetIt = groupWidgets.find(groupId); |
|
|
|
auto groupWidgetIt = groupWidgets.find(groupId); |
|
|
@ -2742,3 +2738,17 @@ void Widget::formatWindowTitle(const QString& content) |
|
|
|
setWindowTitle(content + " - qTox"); |
|
|
|
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()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|