[Add] Push notifications
This commit is contained in:
parent
52c9c31c1a
commit
9d7438d1cb
1 changed files with 12 additions and 0 deletions
|
|
@ -955,6 +955,12 @@ impl OmikronConnection {
|
||||||
MessageState::Sent,
|
MessageState::Sent,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Send push notification to Omega since user is offline
|
||||||
|
let push_msg = CommunicationValue::new(CommunicationType::push_notification)
|
||||||
|
.with_receiver(receiver_id as u64)
|
||||||
|
.add_data(DataTypes::sender_id, DataValue::Number(sender_id as i64));
|
||||||
|
self.send_message(&push_msg).await;
|
||||||
|
|
||||||
// notify sender
|
// notify sender
|
||||||
self.send_message(
|
self.send_message(
|
||||||
&CommunicationValue::new(CommunicationType::message_state)
|
&CommunicationValue::new(CommunicationType::message_state)
|
||||||
|
|
@ -1071,6 +1077,12 @@ impl OmikronConnection {
|
||||||
MessageState::Sent,
|
MessageState::Sent,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Send push notification to Omega since user is offline
|
||||||
|
let push_msg = CommunicationValue::new(CommunicationType::push_notification)
|
||||||
|
.with_receiver(*receiver_id)
|
||||||
|
.add_data(DataTypes::sender_id, DataValue::Number(*sender_id as i64));
|
||||||
|
self.send_message(&push_msg).await;
|
||||||
|
|
||||||
self.send_message(
|
self.send_message(
|
||||||
&CommunicationValue::new(CommunicationType::message_state)
|
&CommunicationValue::new(CommunicationType::message_state)
|
||||||
.with_id(cv.get_id())
|
.with_id(cv.get_id())
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue