Top

Bug when retrieving IMMessage Jid on Android Rainbow Messaging SDK

Comments

3 comments

  • Official comment
    Jérôme Gully

    Hi, sorry for the time to answer !

    When you chat (sent and recieve IMMessage directly), messages sent by you have your Jid and messages recieves from the other contact have the Jid of the contact. When you retrieve IMMessage of a conversation from history (mam), all IMMessage have the Jid of the contact associated with the Conversation.

    You can retrieve if the IMMessage is from you with "imMessage.isMsgSent()"

    Maybe in the future we will update this behavior to always have the right Jid.

    Comment actions Permalink
  • Juan Antonio Garcia

    Hello, I had the same problem and I was able to solve it in android using the method "imMessage.isMsgSent()", however I am also doing the same development on iOS and I have encountered the same problem, but in this case the "message" object does not have a "isMsgSent method.

    How could I fix it with the iOS SDK?

    0
    Comment actions Permalink
  • Vincent CHANN

    Hi @Juan Antonio Garcia,

    On Android I have found a way to know if the message is from the account you are currently connected with, or from the other person you talk with in the conversation.
    When you retrieve the array of IMMessage, each IMMessage has a deliveryState "immessage.deliveryState" :

    public static enum DeliveryState {

    // message from the account you are currently connected with
    SENT,
    TO_RESENT,
    SENT_SERVER_RECEIVED,
    SENT_CLIENT_RECEIVED,
    SENT_CLIENT_READ,
    // message from the other person you talk with in the conversation
    RECEIVED,
    READ,

    // unknown
    UNKNOWN;
    }
    0
    Comment actions Permalink

Please sign in to leave a comment.

  • Ask the Community

    Do you need help? Ask your questions to the Community and get answers from other Rainbow users.

    Post message