mirror of
https://gitee.com/Zhaoxin59/my-chat_-client.git
synced 2026-02-14 09:01:50 +08:00
add button functionality
This commit is contained in:
@ -294,6 +294,75 @@ namespace model
|
||||
netClient.sendMessage(loginSessionId, chatSessionId, MessageType::TEXT_TYPE, content.toUtf8(), "");
|
||||
}
|
||||
|
||||
void DataCenter::changeNicknameAsync(const QString& nickname)
|
||||
{
|
||||
netClient.changeNickname(loginSessionId, nickname);
|
||||
}
|
||||
|
||||
void DataCenter::resetNickname(const QString& nickname)
|
||||
{
|
||||
if (myself == nullptr) {
|
||||
return;
|
||||
}
|
||||
myself->nickname = nickname;
|
||||
}
|
||||
|
||||
void DataCenter::changeDescriptionAsync(const QString& desc)
|
||||
{
|
||||
netClient.changeDescription(loginSessionId, desc);
|
||||
}
|
||||
|
||||
void DataCenter::resetDescription(const QString& desc)
|
||||
{
|
||||
if (myself == nullptr) {
|
||||
return;
|
||||
}
|
||||
myself->description = desc;
|
||||
}
|
||||
|
||||
void DataCenter::getVerifyCodeAsync(const QString& email)
|
||||
{
|
||||
//这个操作,不需要loginSessionId
|
||||
//
|
||||
netClient.getVerifyCode(email);
|
||||
}
|
||||
|
||||
void DataCenter::resetVerifyCodeId(const QString& verifyCodeId)
|
||||
{
|
||||
this->currentVerifyCodeId = verifyCodeId;
|
||||
}
|
||||
|
||||
const QString& DataCenter::getVerifyCodeId() const
|
||||
{
|
||||
return currentVerifyCodeId;
|
||||
}
|
||||
|
||||
void DataCenter::changePhoneAsync(const QString& email, const QString& verifyCodeId, const QString& verifyCode)
|
||||
{
|
||||
netClient.changeEmail(loginSessionId, email, verifyCodeId, verifyCode);
|
||||
}
|
||||
|
||||
void DataCenter::resetPhone(const QString& email)
|
||||
{
|
||||
if (myself == nullptr) {
|
||||
return;
|
||||
}
|
||||
myself->phone = email;
|
||||
}
|
||||
|
||||
void DataCenter::changeAvatarAsync(const QByteArray& imageBytes)
|
||||
{
|
||||
netClient.changeAvatar(loginSessionId, imageBytes);
|
||||
}
|
||||
|
||||
void DataCenter::resetAvatar(const QByteArray& avatar)
|
||||
{
|
||||
if (myself == nullptr) {
|
||||
return;
|
||||
}
|
||||
myself->avatar = makeIcon(avatar);
|
||||
}
|
||||
|
||||
ChatSessionInfo* DataCenter::findChatSessionById(const QString& chatSessionId)
|
||||
{
|
||||
if (chatSessionList == nullptr) {
|
||||
@ -347,6 +416,19 @@ namespace model
|
||||
chatSessionList->push_front(backup);
|
||||
}
|
||||
|
||||
UserInfo* DataCenter::findFriendById(const QString& userId)
|
||||
{
|
||||
if (this->friendList == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
for (auto& f : *friendList) {
|
||||
if (f.userId == userId) {
|
||||
return &f;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void DataCenter::setCurrentChatSessionId(const QString& chatSessionId)
|
||||
{
|
||||
this->currentChatSessionId = chatSessionId;
|
||||
|
||||
Reference in New Issue
Block a user