please select
  • UIKit
  • SDK
  • Server APIs
Chat/
SDK/
Unity(Game Solution)/
Message/
SDK
  • Run Demo
  • SDK Integration
  • Initialization
  • Login and Logout
  • Message
    • Message Overview
    • Sending Message
    • Receiving Message
    • Historical Message
    • Forwarding Message
    • Modifying Message
    • Deleting Message
    • Clearing Messages
    • Recalling Message
    • Online Message
    • Read Receipt
    • Querying Message
    • Group @ Message
    • Targeted Group Message
    • Notification Muting
    • Message Extension
  • Conversation
    • Conversation Overview
    • Conversation List
    • Getting Conversation
    • Conversation Unread Count
    • Pinning Conversation to the Top
    • Deleting Conversation
    • Conversation Draft
    • Conversation Mark
    • Conversation Group
  • Group
    • Group Overview
    • Group Management
    • Group Profile
    • Group Member Management
    • Group Member Profile
    • Custom Group Attribute
    • Group Counter
  • User
    • User Profile
    • User Status
    • Friend Management
    • Friend List
    • Blocklist
  • Changelog
  • Guideline for Beginners
  • Console Guide
    • Creating and Upgrading an Application
    • Basic Configuration
    • Feature Configuration
    • Account Management
    • Group Management
    • Webhook Configuration
  • Product Introduction
    • Message Management
      • One-to-One Message
      • Message Storage
      • Offline Push
      • Group Message
      • Message Formats
    • Account System
      • Login Authentication
      • Online Status Management
    • Group Related
      • Group System
      • Group Management
    • User Profile and Relationship Chain
      • Profile Management
      • Relationship Chain Management
  • Purchase Guide
    • Billing Overview
    • Pricing
  • Error Codes

Modifying Message

Overview

This feature enables any member in a conversation to modify a successfully sent message in the conversation. The message will be synced to all the members in the conversation once modified successfully.
Note:
This feature is supported only on native SDK 6.2.2363 or later.

Modifying a Message

A conversation participant can call the MsgModifyMessage API (details) to modify a sent message in the conversation. The Chat SDK allows any conversation participant to modify a message in the conversation. You can add more restrictions at the business layer, for example, only allowing the message sender to modify the message.
Currently, the following information of a message can be modified:
message_custom_str (Details)
message_custom_int (Details)
message_cloud_custom_str (Details)
kTIMElem_Text (Details)
kTIMElem_Custom (Details)
Sample code:
originMessage.message_cloud_custom_str = "change data";
TIMResult res = TencentIMSDK.MsgModifyMessage(originMessage, (int code, string desc, string json_param, string user_data)=>{
// Async result of the message modification
});

Listening for a Message Modification Callback

If you have added an event listener for message modification callbacks via the SetMsgUpdateCallback API, when a message in a conversation is modified, all participants of the conversation will receive the MsgUpdateCallback (details) callback, which contains the modified message objects.
Sample code:
TencentIMSDK.SetMsgUpdateCallback((List<Message> message_list, string user_data) => {
// `message_list` is the list of modified message objects.
});