Ditto 4.8.0-rc.2
Loading...
Searching...
No Matches
ditto::Peer Class Reference

Represent a known peer in the Ditto network. More...

#include <PresenceGraph.hpp>

Public Member Functions

 DITTO_DEPRECATED_BECAUSE ("Query overlap groups have been phased out, this " "property always returns 0.") uint8_t query_overlap_group
 This field is no longer in use and will always be 0.
 

Public Attributes

DittoAddress address
 Address to contact this peer via Ditto Bus.
 
std::vector< uint8_t > peer_key
 
std::string peer_key_string
 The peer key is a unique identifier for a given peer, equal to or derived from the cryptographic public key used to authenticate it.
 
std::string device_name
 The human-readable device name of the remote peer. This defaults to the hostname but can be manually set by the application developer of the other peer. It is not necessarily unique.
 
std::string os
 Operating system of the remote peer.
 
bool is_connected_to_ditto_cloud
 Indicates whether the peer is connected to Ditto Cloud.
 
bool is_compatible
 Indicates whether the peer is compatible with the current peer.
 
std::string ditto_sdk_version
 The Ditto SDK version the peer is running with.
 
std::vector< Connectionconnections
 Currently active connections of the peer.
 
nlohmann::json peer_metadata
 Metadata associated with the peer, or empty map by default.
 
nlohmann::json identity_service_metadata
 Metadata associated with the peer by the identity service.
 

Detailed Description

Represent a known peer in the Ditto network.

Member Data Documentation

◆ identity_service_metadata

nlohmann::json ditto::Peer::identity_service_metadata

Metadata associated with the peer by the identity service.

Use an authentication webhook to set this value. See Ditto's online documentation for more information on how to configure an authentication webhook.

◆ peer_key

std::vector<uint8_t> ditto::Peer::peer_key
Deprecated
Use peer_key_string instead. instead.

◆ peer_key_string

std::string ditto::Peer::peer_key_string

The peer key is a unique identifier for a given peer, equal to or derived from the cryptographic public key used to authenticate it.

Note
This will be be empty when a peer is not updated to the latest version of the SDK.

◆ peer_metadata

nlohmann::json ditto::Peer::peer_metadata

Metadata associated with the peer, or empty map by default.

Use Presence::set_peer_metadata or Presence::set_peer_metadata_json_string to set this value.

Peer metadata is dynamic and may change over the lifecycle of the PresenceGraph. It may be empty when a remote peer initially appears in the presence graph and will be updated once the peer has synced its metadata with the local peer.

See also
Presence::peer_metadata for details on usage of metadata.