mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
feat: change message and contac list attribute
This commit is contained in:
@@ -102,20 +102,22 @@ QByteArray DBAnswerParser::listClassrooms(bool result, QList<Classroom> *listCla
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
QByteArray DBAnswerParser::listContacts(bool result, QList<User> *listContacts)
|
||||
QByteArray DBAnswerParser::listContacts(bool result, QList<ContactModel> *listContacts)
|
||||
{
|
||||
QDomDocument doc;
|
||||
QDomProcessingInstruction xmlDecl = doc.createProcessingInstruction("xml", "version='1.0' encoding='utf-8'");
|
||||
doc.insertBefore(xmlDecl,doc.firstChild());
|
||||
QDomElement root = doc.createElement("ContactArray");
|
||||
|
||||
for(User entity : *listContacts)
|
||||
for(ContactModel entity : *listContacts)
|
||||
{
|
||||
QDomElement contact = doc.createElement("ContactData");
|
||||
contact.toElement().setAttribute("name",entity.getName());
|
||||
contact.toElement().setAttribute("id",entity.getID());
|
||||
QString isLogged = entity.getLoggedIn() ? "1" : "0";
|
||||
contact.toElement().setAttribute("isOnline",isLogged);
|
||||
contact.toElement().setAttribute("UserType",entity.getType());
|
||||
contact.toElement().setAttribute("Login",entity.getLogin());
|
||||
|
||||
root.appendChild(contact);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user