/
Shymer123
/
Messenger
Обзор
Документация
Войти
/
Shymer123
/
Messenger
Код
Запросы
0
Задачи
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
UI_Client/SourceFiles/Chats/createDialog.cpp
39 строк
1 KB
Shymer123
The code has been refactored, now there are no incomprehensible UserRole, etc.
19 май 2025, 13:22
19 май 2025, 13:22
f8b3525
Код
Авторство
О чём код?
#include "createDialog.h" #include "RequestResponseHandler/dependencyManager.h" #include "DataModels/user_data.h" #include <QJsonObject> createDialog::createDialog(const int tempChatID, const QString& contactName) { m_communicationHandler = DependencyManager::instance().communicationHandler(); m_user1_id = UserData::instance().getID(); m_tempChatID = tempChatID; m_contactName = contactName; insertDialogDataBase(); } createDialog::createDialog(const int tempChatID, const bool isFavourite) { m_communicationHandler = DependencyManager::instance().communicationHandler(); m_user1_id = UserData::instance().getID(); m_tempChatID = tempChatID; m_isFavourite = isFavourite; insertDialogDataBase(); } void createDialog::insertDialogDataBase() { if(m_isFavourite) { m_communicationHandler->addFavourite(m_user1_id, m_tempChatID); } else { m_communicationHandler->addDialog(m_user1_id, m_contactName, m_tempChatID); } emit dialogCreated(); }