status-im / status-web

Apache License 2.0
79 stars 35 forks source link

Online Status #45

Open D4nte opened 2 years ago

D4nte commented 2 years ago

Being able to send and receive information about being online.

D4nte commented 2 years ago

@cammellos Is there and if so, what is, the protocol to check if someone is "online"?

cammellos commented 2 years ago

@Parveshdhull will have the details, would you mind replying to @D4nte please? Thanks!

Parveshdhull commented 2 years ago

Hi @D4nte, The user broadcasts its own online status to its own contact code topic and other users who subscribes to that topic (contacts or community members) will receive his/her online status in new.messages. You can check more details about types of status and other specs, here

D4nte commented 2 years ago

Thanks. I believe @Szymx95 is attempting an implementation.

Szymx95 commented 2 years ago

@Parveshdhull

Status messages are sent into specific topics:

With communities, a topic derived from the community-id with the suffix -ping concatenated. To know the status of a contact, their updates will be sent in their "contact-code" topic

If i understand correctly status messages can be sent to either user specific topic or to community-id+'-ping' topic

message StatusMessage {
  uint64 clock = 1

  StatusType status_type = 2;

  string custom_text = 3

  enum StatusType {
    UNKNOWN_STATUS_TYPE = 0;
    ONLINE = 1;
    DO_NOT_DISTURB = 2;
  }
}

Can I add a field for nickname that broadcasting wants to be seen under, or will this break the spec (i.e. are the fields here only ones that are available or are they just minimum for the spec ) ?

Parveshdhull commented 2 years ago

Hi @Szymx95,

If i understand correctly status messages can be sent to either user specific topic or to community-id+'-ping' topic

A user only sends status messages to his/her own contact topic and other users subscribe to that topic. For Ex. if a user has 100 contacts, then the user will not send his status to all 100 of them, the user will only send his status update to his own contact topic.

D4nte commented 2 years ago

Regarding the nickname, will wait for a consensus to be reached on Status core side first. Tracked by @John-44