presence: Add status and payload insertion helpers.
This commit is contained in:
parent
c420c87bf5
commit
3f4586caba
1 changed files with 10 additions and 0 deletions
|
@ -239,6 +239,16 @@ impl Presence {
|
||||||
self.payloads = payloads;
|
self.payloads = payloads;
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Set the availability information of this presence.
|
||||||
|
pub fn set_status(&mut self, lang: Lang, status: Status) {
|
||||||
|
self.statuses.insert(lang, status);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Add a payload to this presence.
|
||||||
|
pub fn add_payload<P: PresencePayload>(&mut self, payload: P) {
|
||||||
|
self.payloads.push(payload.into());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TryFrom<Element> for Presence {
|
impl TryFrom<Element> for Presence {
|
||||||
|
|
Loading…
Reference in a new issue