tencent cloud

Chat

News and Announcements
Release Notes
Announcements
Product Introduction
Overview
Basic Concepts
Scenarios
Features
Account System
User Profile and Relationship Chain
Message Management
Group Related
Official Account
Audio/Video Call
Use Limits
Purchase Guide
Billing Overview
Pricing
Purchase Instructions
Renewal Guide
Service Suspension Explanation
Refund Policy
Development Guidelines
Demo Zone
Activate Service
Free Demos
Quick Run
Download
SDK and Demo Source Code
Update Log
Chat Interaction (UI Included)
TUIKit Introduction
Getting Started
Full-feature Integration
Single-function Integration
Build with AI
Build Basic Interfaces
More Features
Customizing Appearance
Internationalization
Push Service
Overview
Noun explanation
Activate the Service
Quick Start
Manufacturer Channel
Statistics
Troubleshooting Tool
Client APIs
REST API
Push Callback
Advanced Features
Release Notes
Error Codes
FAQS
Desk
Overview
Quick Start
Integration Guide
Admin Operation Manual
Agent Manual
More Practices
Live Streaming Setup Guide
AI Chatbot
Super Large Entertainment and Collaboration Community
Discord Implementation Guide
How to Integrate Chat into Games
WhatsApp Channel-style Official Account Integration Solution
Send Red Packet
Firewall Restrictions
No UI Integration
Quick Start
SDK Integration
Initialization
Login and Logout
Message
Conversation
Group
Community Topic
User Profile and Relationship Chain
Offline Push
Cloud Search
Local Search
Official Channel Management
Client APIs
JavaScript
Android
iOS & macOS
Swift
Flutter
Electron
Unity
React Native
C APIs
C++
Server APIs
Secure authentication with UserSig
RESTful APIs
Webhooks
Console Guide
New Console Introduction
Creating and Upgrading an Application
Basic Configuration
Feature Configuration
Account Management
Group Management
Official Channel Management
Webhook Configuration
Usage
Viewing Guide for Resource Packages
Real-Time Monitor
Auxiliary Development Tools
Access Management
Advanced Features
FAQs
uni-app FAQs
Purchase
SDK
Account Authentication
User Profile and Relationship Chain
Message
Group
Audio-Video Group
Nickname and Profile Photo
Security Compliance Certification
Service Level Agreement
Security Compliance Certification
Chat Policies
Privacy Policy
Data Privacy and Security Agreement
Migration
Migration Solutions
Migration Solutions Lite
Error Codes
Contact Us
DocumentationChatFAQsNickname and Profile Photo

Nickname and Profile Photo

PDF
Focus Mode
Font Size
Last updated: 2024-02-07 17:33:31

Nickname and Profile Photo Update in Conversations

Conversations do not store nicknames and profile photos. Therefore, the SDK needs to obtain them from user profiles or group profiles saved in the local storage and use them in conversations. For a one-to-one conversation, the SDK obtains and uses the other user's nickname and profile photo. For a group conversation, the SDK obtains and uses the group name and group profile photo. To keep local user profiles and group profiles up-to-date, the latest SDK version has the following optimizations:
Ono-to-one chats:
1. When a user actively obtains a conversation or the SDK calls back a conversation update, if the SDK detects that the local storage does not have the other user's profile, it will synchronize the user's profile from the server and save it locally.
1. If a friend's profile is changed, the SDK will receive a notification of the change from the backend and update the friend's profile locally. If a stranger's profile is changed, the backend will not send notifications, so the stranger's profile will not be updated locally. However, you can call the getFriendsInfo API to get strangers' profiles and update them locally.
1. When sending a message, the backend will attach the user's latest nickname and profile photo to the message body. After receiving the message, the SDK will update the nickname and profile photo locally if the user's profile already exists in the local storage.
In summary, the SDK will ensure that the nicknames and profile photos in conversations with friends are up-to-date. While with strangers, the SDK cannot guarantee that and you need to actively pull the nicknames and profile photos if needed.
Group chats:
1. After you join a group successfully, the SDK will actively obtain the group profile and save it locally.
1. When the profile of a group that you have joined is modified, the backend will notify the client, which will then update the group profile locally in time.
In summary, the SDK will ensure that the nicknames and profile photos in conversations are up-to-date for groups you have joined, but not for groups that you haven't joined or have left.
Caution:
The change of user profiles or group profiles do not trigger conversation update. Therefore, the nicknames and profile photos in a conversation will not be updated until the next conversation operation is performed (such as actively obtaining the conversation, marking the conversation as read, and sending/receiving messages).
There is no relationship chain between you and a stranger. If the stranger's profile is changed, the backend will not send notifications, and the stranger's local profile will not be updated. It will be updated only when you actively pull the stranger's profile.

Nickname and Profile Photo Update in the Message List

Messages store nicknames and profile photos. In order to keep the nicknames and profile photos of messages up-to-date, the latest SDK version has the following optimizations:
1. When sending a message, the backend will attach the user's latest nickname and profile photo to the message body. After receiving the message, the SDK will update the nickname and profile photo locally if the user's profile already exists in the local storage.
2. After a message is successfully sent and received, the nickname and profile photo stored in the message cannot be modified. In order to get the new nicknames and profile photos for historical messages, the SDK will first query local user profiles when trying to obtain the nickname and profile photo fields via messages. If local user profiles exist, local nicknames and profile photos will be returned. (According to optimization 1, local nicknames and profile photos will be updated in real time according to new messages.) If not, the nicknames and profile photos in message bodies will be returned.
In summary, the SDK will ensure that the nicknames and profile photos of new messages are up-to-date, but not those of historical messages. The nicknames and profile photos of historical messages will be updated only when the senders' profiles exist in the local storage.

FAQs

According to the above description, the latest SDK version has a lot of optimizations regarding nickname and profile photo. If you encounter any nickname and profile photo issues, please first upgrade your SDK to the latest version and check whether the issues are solved. If not, please see the following FAQs:

Why isn't the conversation updated immediately when the nickname and profile photo are changed?

The change of nicknames and profile photos do not trigger conversation update. Therefore, the nickname and profile photo in a conversation will not be updated until the next conversation operation is performed (such as actively obtaining the conversation, marking the conversation as read, and sending/receiving messages). However, you can listen for friend or group profile update notifications to update the nicknames and profile photos in conversations.

Why isn't the conversation updated when the stranger's nickname and profile photo are changed?

There is no relationship chain between you and a stranger. If the stranger's profile is changed, the backend will not send notifications, and the stranger's local profile will not be updated. It will be updated only when you actively pull the stranger's profile or receive a message from the stranger. The message will carry the stranger's latest nickname and profile photo, and the SDK will update them locally after receiving the message.

Why can't the nicknames and profile photos of historical messages be updated?

Please refer to optimization 2 in Nickname and Profile Photo Update in the Message List. If the local storage does not have the senders' profiles, the nicknames and profile photos of historical messages won't be updated. They will be updated only when you actively pull the senders' profiles.

Why doesn't the SDK actively pull user profiles when conversations are updated, or messages are received?

Conversation update and message sending/receiving are both frequent events. Synchronizing user profiles every time will cause huge pressure on the client and backend, seriously affecting application performance. We don't recommend that you actively pull user profiles in both cases, because it also affects application performance. The recommended approach is to pull user profiles when users click on the profile photos of messages.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback