mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-15 11:38:49 -07:00
more work on buddy&ignore
This commit is contained in:
parent
4149f78001
commit
0afdbc7222
9 changed files with 28 additions and 21 deletions
|
|
@ -228,9 +228,9 @@ ServerInfo_User *Servatrice::getUserData(const QString &name)
|
|||
return new ServerInfo_User(name, ServerInfo_User::IsUser);
|
||||
}
|
||||
|
||||
QList<ServerInfo_User *> Servatrice::getBuddyList(const QString &name)
|
||||
QMap<QString, ServerInfo_User *> Servatrice::getBuddyList(const QString &name)
|
||||
{
|
||||
QList<ServerInfo_User *> result;
|
||||
QMap<QString, ServerInfo_User *> result;
|
||||
|
||||
const QString method = settings->value("authentication/method").toString();
|
||||
if (method == "sql") {
|
||||
|
|
@ -242,15 +242,17 @@ QList<ServerInfo_User *> Servatrice::getBuddyList(const QString &name)
|
|||
if (!execSqlQuery(query))
|
||||
return result;
|
||||
|
||||
while (query.next())
|
||||
result.append(evalUserQueryResult(query, false));
|
||||
while (query.next()) {
|
||||
ServerInfo_User *temp = evalUserQueryResult(query, false);
|
||||
result.insert(temp->getName(), temp);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
QList<ServerInfo_User *> Servatrice::getIgnoreList(const QString &name)
|
||||
QMap<QString, ServerInfo_User *> Servatrice::getIgnoreList(const QString &name)
|
||||
{
|
||||
QList<ServerInfo_User *> result;
|
||||
QMap<QString, ServerInfo_User *> result;
|
||||
|
||||
const QString method = settings->value("authentication/method").toString();
|
||||
if (method == "sql") {
|
||||
|
|
@ -262,8 +264,10 @@ QList<ServerInfo_User *> Servatrice::getIgnoreList(const QString &name)
|
|||
if (!execSqlQuery(query))
|
||||
return result;
|
||||
|
||||
while (query.next())
|
||||
result.append(evalUserQueryResult(query, false));
|
||||
while (query.next()) {
|
||||
ServerInfo_User *temp = evalUserQueryResult(query, false);
|
||||
result.insert(temp->getName(), temp);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,8 +51,8 @@ public:
|
|||
protected:
|
||||
bool userExists(const QString &user);
|
||||
AuthenticationResult checkUserPassword(const QString &user, const QString &password);
|
||||
QList<ServerInfo_User *> getBuddyList(const QString &name);
|
||||
QList<ServerInfo_User *> getIgnoreList(const QString &name);
|
||||
QMap<QString, ServerInfo_User *> getBuddyList(const QString &name);
|
||||
QMap<QString, ServerInfo_User *> getIgnoreList(const QString &name);
|
||||
private:
|
||||
QTimer *pingClock, *statusUpdateClock;
|
||||
QTcpServer *tcpServer;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue