/
Shymer123
/
Messenger
Обзор
Документация
Войти
/
Shymer123
/
Messenger
Код
Запросы
0
Задачи
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
UI_Client/SourceFiles/DataModels/current_chat_data.cpp
98 строк
2 KB
Shymer123
redesigned dialog creation (all processing on the server)
12 май 2025, 15:30
12 май 2025, 15:30
5cc9e9a
Код
Авторство
О чём код?
#include "current_chat_data.h" CurrentChatData& CurrentChatData::instance() { static CurrentChatData instance; return instance; } void CurrentChatData::resetFull() { m_chatType = ChatTypes::Unknown; m_chatID = -1; m_userID = -1; m_name.clear(); m_username.clear(); m_phoneNumber.clear(); m_status.clear(); } void CurrentChatData::setDialog(int chatID, int userID, const QString& username, const QString& phoneNumber) { reset(); m_chatType = ChatTypes::Dialog; m_chatID = chatID; m_userID = userID; m_username = username; m_phoneNumber = phoneNumber; } void CurrentChatData::setGroup(int chatID, const QString& status) { reset(); m_chatType = ChatTypes::Group; m_chatID = chatID; m_status = status; } void CurrentChatData::reset() { m_chatType = ChatTypes::Unknown; m_chatID = -1; m_userID = -1; m_username.clear(); m_phoneNumber.clear(); } void CurrentChatData::setChatType(const ChatTypes& type) { m_chatType = type; } void CurrentChatData::setName(const QString& name) { m_name = name; } void CurrentChatData::setParticipantID(const int participantID) { m_userID = participantID; } ChatTypes CurrentChatData::chatType() const { return m_chatType; } int CurrentChatData::chatID() const { return m_chatID; } int CurrentChatData::userID() const { return m_userID; } QString CurrentChatData::name() const { return m_name; } QString CurrentChatData::status() const { return m_status; } QString CurrentChatData::username() const { return m_username; } QString CurrentChatData::phoneNumber() const { return m_phoneNumber; }