సందేశం ప్రదర్శన స్థితి

సాధారణంగా ప్రతి క్లయింట్ ఏ పీర్ ఏ సందేశాన్ని చదువుతుందో చూపించగలడు మరియు ఎన్ని చదవని సందేశాలు ఉన్నాయో తెలుసుకోవాలి.

దీని కోసం, డీమోన్ కొన్ని API లను అందిస్తుందిః

ప్రదర్శించబడిన సందేశాన్ని సెట్ చేయండి

కాన్ఫిగరేషన్ మేనేజర్ ఇలా అందిస్తుందిః

<method name="setMessageDisplayed" tp:name-for-bindings="setMessageDisplayed">
    <tp:added version="8.1.0"/>
    <tp:docstring>
        <p>Informs that a message have been read</p>
    </tp:docstring>
    <arg type="s" name="accountId" direction="in">
        <tp:docstring>
        The account ID
        </tp:docstring>
    </arg>
    <arg type="s" name="conversationUri" direction="in">
        <tp:docstring>
        A conversation uri (swarm:xxxx or jami:xxxx)
        </tp:docstring>
    </arg>
    <arg type="s" name="messageId" direction="in">
        <tp:docstring>
        The message ID
        </tp:docstring>
    </arg>
    <arg type="i" name="status" direction="in">
        <tp:docstring>
        The message status, 3 for displayed
        </tp:docstring>
    </arg>
    <arg type="b" name="success" direction="out">
        <tp:docstring>
        True if the message status was set, false if account, contact or message is unknown.
        </tp:docstring>
    </arg>
</method>

సందేశాన్ని ప్రదర్శించిన విధంగా సెట్ చేయడానికి. పరస్పర చర్య ప్రదర్శించబడినప్పుడు మరియు సంభాషణ ఎంచుకున్నప్పుడు చేయాలి.

ఇది కింది ఫార్మాట్తో అనుసంధానించబడిన సహచరులకు SIP సందేశాలను పంపుతుందిః

std::string
getDisplayed(const std::string& conversationId, const std::string& messageId)
{
    // implementing https://tools.ietf.org/rfc/rfc5438.txt
    return fmt::format(
        "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n"
        "<imdn><message-id>{}</message-id>\n"
        "{}"
        "<display-notification><status><displayed/></status></display-notification>\n"
        "</imdn>",
        messageId,
        conversationId.empty() ? "" : "<conversation>" + conversationId + "</conversation>");
}

అప్పుడు పీర్ onMessageDisplayed ద్వారా ఈ విషయం తెలుసుకుంటాడు మరియు క్లయింట్కు ఒక సిగ్నల్ పంపిస్తాడు (libjami::ConfigurationSignal::AccountMessageStatusChanged with status 3 (libjami::Account::MessageStates::DISPLAYED))

చదవని సందేశాలను పొందండి

మా ఖాతా కోసం చివరి ప్రదర్శించబడిన సందేశాన్ని తెలుసుకోవడం ద్వారా, మేము ఈ సమాచారాన్ని మరియు ConfigrationManager::countInteractionsSince ను ఉపయోగించవచ్చు, ఇది ఇచ్చిన సందేశానికి చివరి సందేశం నుండి పరస్పర చర్యను లెక్కిస్తుంది (సాధారణంగా చివరి ప్రదర్శించబడిన పరస్పర చర్య)

సభ్యునికి చివరిసారిగా ప్రదర్శించబడిన సందేశాన్ని పొందడానికి, Configuration::getConversationMembers ప్రతి సభ్యుడు `memberInfo["lastDisplayed"] ద్వారా అందుబాటులో ఉన్న చివరి ప్రదర్శించబడిన పరస్పర చర్యను కలిగి ఉంటారు

ఈ సమాచారం ఎలా నిల్వ చేయబడుతుంది

src/jamidht/conversation.cpp లో ప్రతి సంభాషణ మ్యాప్లో చివరి ప్రదర్శించబడిన సందేశాలను నిల్వ చేస్తుంది<string, string> (uri, interactionId) మరియు ఈ నిర్మాణం fileutils::get_data_dir()/getAccountID()/conversation_data/repository_->id()/lastDisplayed