public class

OneToOneChat

extends Object
java.lang.Object
   ↳ com.gsma.services.rcs.chat.OneToOneChat

Class Overview

One-to-One Chat

Summary

Public Methods
ContactId getRemoteContact()
Returns the remote contact
boolean isAllowedToSendMessage()
Returns true if it is possible to send messages in this one to one chat right now, else return false.
void openChat()
open the chat conversation.
void resendMessage(String msgId)
Resend a message which previously failed.
ChatMessage sendMessage(Geoloc geoloc)
Sends a geoloc message
ChatMessage sendMessage(String message)
Sends a chat message
void setComposingStatus(boolean ongoing)
This method should be called to notify the stack of if there is ongoing composing or not in this OneToOneChat.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public ContactId getRemoteContact ()

Since: API Level 1.5

Returns the remote contact

Returns
  • ContactId

public boolean isAllowedToSendMessage ()

Since: API Level 1.5

Returns true if it is possible to send messages in this one to one chat right now, else return false.

Returns
  • boolean
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public void openChat ()

Since: API Level 1.5

open the chat conversation.
Note: if it is an incoming pending chat session and the parameter IM SESSION START is 0 then the session is accepted now.

public void resendMessage (String msgId)

Since: API Level 1.5

Resend a message which previously failed.

Parameters
msgId the message ID
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public ChatMessage sendMessage (Geoloc geoloc)

Since: API Level 1.5

Sends a geoloc message

Parameters
geoloc Geoloc info
Returns
  • ChatMessage
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public ChatMessage sendMessage (String message)

Since: API Level 1.5

Sends a chat message

Parameters
message Message
Returns
  • ChatMessage
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public void setComposingStatus (boolean ongoing)

Since: API Level 1.5

This method should be called to notify the stack of if there is ongoing composing or not in this OneToOneChat. If there is an ongoing chat session established with the remote side corresponding to this OneToOneChat this means that a call to this method will send the 'is-composing' event or the 'is-not-composing' event to the remote side. However since this method can be called at any time even when there is no chat session established with the remote side or when the stack is not even connected to the IMS server then the stack implementation needs to hold the last given information (i.e. composing or not composing) in memory and then send it later when there is an established session available to relay this information on. Note: if this OneToOneChat corresponds to an incoming pending chat session and the parameter IM SESSION START is 1 then the session is accepted before sending the 'is-composing' event.

Parameters
ongoing True is client application is composing