mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Merge branch 'pr714'
This commit is contained in:
commit
133fb2f9d3
|
@ -33,7 +33,7 @@ ToxID ToxID::fromString(QString id)
|
|||
ToxID toxID;
|
||||
toxID.publicKey = id.left(TOX_ID_PUBLIC_KEY_LENGTH);
|
||||
toxID.noSpam = id.mid(TOX_ID_PUBLIC_KEY_LENGTH, TOX_ID_NO_SPAM_LENGTH);
|
||||
toxID.checkSum = id.right(TOX_ID_CHECKSUM_LENGTH);
|
||||
toxID.checkSum = id.mid(TOX_ID_PUBLIC_KEY_LENGTH + TOX_ID_NO_SPAM_LENGTH, TOX_ID_CHECKSUM_LENGTH);
|
||||
return toxID;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#include "friend.h"
|
||||
#include "friendlist.h"
|
||||
#include "src/misc/settings.h"
|
||||
#include <QMenu>
|
||||
#include <QDebug>
|
||||
#include <QHash>
|
||||
|
@ -49,7 +50,10 @@ void FriendList::removeFriend(int friendId)
|
|||
{
|
||||
auto f_it = friendList.find(friendId);
|
||||
if (f_it != friendList.end())
|
||||
{
|
||||
Settings::getInstance().removeFriendSettings(f_it.value()->getToxID());
|
||||
friendList.erase(f_it);
|
||||
}
|
||||
}
|
||||
|
||||
void FriendList::clear()
|
||||
|
|
|
@ -857,6 +857,12 @@ void Settings::setFriendAlias(const ToxID &id, const QString &alias)
|
|||
}
|
||||
}
|
||||
|
||||
void Settings::removeFriendSettings(const ToxID &id)
|
||||
{
|
||||
QString key = id.publicKey;
|
||||
friendLst.remove(key);
|
||||
}
|
||||
|
||||
bool Settings::getFauxOfflineMessaging() const
|
||||
{
|
||||
return fauxOfflineMessaging;
|
||||
|
|
|
@ -199,6 +199,8 @@ public:
|
|||
QString getFriendAlias(const ToxID &id) const;
|
||||
void setFriendAlias(const ToxID &id, const QString &alias);
|
||||
|
||||
void removeFriendSettings(const ToxID &id);
|
||||
|
||||
bool getFauxOfflineMessaging() const;
|
||||
void setFauxOfflineMessaging(bool value);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user