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 toxID;
|
||||||
toxID.publicKey = id.left(TOX_ID_PUBLIC_KEY_LENGTH);
|
toxID.publicKey = id.left(TOX_ID_PUBLIC_KEY_LENGTH);
|
||||||
toxID.noSpam = id.mid(TOX_ID_PUBLIC_KEY_LENGTH, TOX_ID_NO_SPAM_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;
|
return toxID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
#include "friend.h"
|
#include "friend.h"
|
||||||
#include "friendlist.h"
|
#include "friendlist.h"
|
||||||
|
#include "src/misc/settings.h"
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
|
@ -49,8 +50,11 @@ void FriendList::removeFriend(int friendId)
|
||||||
{
|
{
|
||||||
auto f_it = friendList.find(friendId);
|
auto f_it = friendList.find(friendId);
|
||||||
if (f_it != friendList.end())
|
if (f_it != friendList.end())
|
||||||
|
{
|
||||||
|
Settings::getInstance().removeFriendSettings(f_it.value()->getToxID());
|
||||||
friendList.erase(f_it);
|
friendList.erase(f_it);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void FriendList::clear()
|
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
|
bool Settings::getFauxOfflineMessaging() const
|
||||||
{
|
{
|
||||||
return fauxOfflineMessaging;
|
return fauxOfflineMessaging;
|
||||||
|
|
|
@ -199,6 +199,8 @@ public:
|
||||||
QString getFriendAlias(const ToxID &id) const;
|
QString getFriendAlias(const ToxID &id) const;
|
||||||
void setFriendAlias(const ToxID &id, const QString &alias);
|
void setFriendAlias(const ToxID &id, const QString &alias);
|
||||||
|
|
||||||
|
void removeFriendSettings(const ToxID &id);
|
||||||
|
|
||||||
bool getFauxOfflineMessaging() const;
|
bool getFauxOfflineMessaging() const;
|
||||||
void setFauxOfflineMessaging(bool value);
|
void setFauxOfflineMessaging(bool value);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user