Signaling (previously RTM) SDK v1.5.0 API Reference for Windows (C++)
Public Member Functions | List of all members
agora::rtm::IFileMessage Class Referenceabstract

#include <IAgoraRtmService.h>

Inherits agora::rtm::IMessage.

Public Member Functions

virtual long long  getSize () const =0
 
virtual const char *  getMediaId () const =0
 
virtual void  setThumbnail (const uint8_t *thumbnail, int length)=0
 
virtual const char *  getThumbnailData () const =0
 
virtual const long long  getThumbnailLength () const =0
 
virtual void  setFileName (const char *fileName)=0
 
virtual const char *  getFileName () const =0
 
virtual long long  getMessageId () const =0
 
virtual MESSAGE_TYPE  getMessageType () const =0
 
virtual void  setText (const char *str)=0
 
virtual const char *  getText () const =0
 
virtual const char *  getRawMessageData () const =0
 
virtual int  getRawMessageLength () const =0
 
virtual long long  getServerReceivedTs () const =0
 
virtual bool  isOfflineMessage () const =0
 
virtual void  release ()=0
 

Member Function Documentation

◆ getSize()

virtual long long agora::rtm::IFileMessage::getSize ( ) const
pure virtual

Gets the size of the uploaded file.

Returns
The size of the uploaded file in bytes.

◆ getMediaId()

virtual const char * agora::rtm::IFileMessage::getMediaId ( ) const
pure virtual

Gets the media ID of the uploaded file.

Note
  • The media ID is automatically populated once the file is uploaded to the file server.
  • The media ID is valid for 7 days because the file server keeps all uploaded files for 7 days only.
Returns
The media ID of the uploaded file.

◆ setThumbnail()

virtual void agora::rtm::IFileMessage::setThumbnail ( const uint8_t *  thumbnail,
int  length 
)
pure virtual

Sets the thumbnail of the uploaded file.

Parameters
thumbnail The thumbnail of the uploaded file. Must be binary data.
length The length of the thumbnail. The size of thumbnail and fileName combined must not exceed 32 KB.

◆ getThumbnailData()

virtual const char * agora::rtm::IFileMessage::getThumbnailData ( ) const
pure virtual

Gets the thumbnail of the uploaded file.

Returns
The thumbnail of the uploaded file.

◆ getThumbnailLength()

virtual const long long agora::rtm::IFileMessage::getThumbnailLength ( ) const
pure virtual

Gets the length of the thumbnail.

Returns
The length of the thumbnail.

◆ setFileName()

virtual void agora::rtm::IFileMessage::setFileName ( const char *  fileName )
pure virtual

Sets the name of the uploaded file.

Parameters
fileName The name of the uploaded file. The size of thumbnail and fileName combined must not exceed 32 KB.

◆ getFileName()

virtual const char * agora::rtm::IFileMessage::getFileName ( ) const
pure virtual

Gets the name of the uploaded file.

Returns
The name of the uploaded file.

◆ getMessageId()

virtual long long agora::rtm::IMessage::getMessageId ( ) const
pure virtualinherited

Retrieves the unique ID of the message.

Returns
The message ID.

◆ getMessageType()

virtual MESSAGE_TYPE agora::rtm::IMessage::getMessageType ( ) const
pure virtualinherited

Retrieves the message type.

Returns
The message type. See MESSAGE_TYPE.

◆ setText()

virtual void agora::rtm::IMessage::setText ( const char *  str )
pure virtualinherited

Sets the content of a text message, or the text description of a raw message.

Parameters
str The text message to be set. Must not exceed 32 KB in length. If the message is a raw message, ensure that the overall size of the text description and the raw message data does not exceed 32 KB.

◆ getText()

virtual const char * agora::rtm::IMessage::getText ( ) const
pure virtualinherited

Retrieves the content of a text message, or the text description of a raw message.

Returns
The content of the received text message, or the text description of the received raw message.

◆ getRawMessageData()

virtual const char * agora::rtm::IMessage::getRawMessageData ( ) const
pure virtualinherited

Retrieves the starting address of the raw message in the memory.

Returns
The starting address of the raw message in the memory.

◆ getRawMessageLength()

virtual int agora::rtm::IMessage::getRawMessageLength ( ) const
pure virtualinherited

Retrieves the length of the raw message.

Returns
The length of the raw message in Bytes.

◆ getServerReceivedTs()

virtual long long agora::rtm::IMessage::getServerReceivedTs ( ) const
pure virtualinherited

Allows the receiver to retrieve the timestamp of when the messaging server receives this message.

Note
  • You can infer from the returned timestamp the approximate time as to when this message was sent.
  • The returned timestamp is on a millisecond time-scale. It is for demonstration purposes only, not for strict ordering of messages.
Returns
The timestamp (ms) of when the messaging server receives this message.

◆ isOfflineMessage()

virtual bool agora::rtm::IMessage::isOfflineMessage ( ) const
pure virtualinherited

Allows the receiver to check whether this message has been cached on the server (Applies to peer-to-peer message only).

Note
  • This method returns false if a message is not cached by the server. Only if the sender sends the message as an offline message (sets enableOfflineMessaging as true) when the specified user is offline, does the method return true when the user is back online.
  • For now we only cache 200 offline messages for up to seven days for each message receiver. When the number of the cached messages reaches this limit, the newest message overrides the oldest one.
Returns
  • true: This message has been cached on the server (the server caches this message and re-sends it to the receiver when he/she is back online).
  • false: This message has not been cached on the server.

◆ release()

virtual void agora::rtm::IMessage::release ( )
pure virtualinherited

Releases all resources used by the IMessage instance.

Note
For the message receiver: please access and save the content of the IMessage instance when receiving the onMessageReceived or the onMessageReceivedFromPeer callback. The SDK will release the IMessage instance when the callback ends.