mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-16 15:21:24 +01:00
service/sending: tiny refactors, NFC
This commit is contained in:
parent
d9c7fbbd82
commit
81c5f09919
1 changed files with 21 additions and 6 deletions
|
|
@ -576,12 +576,17 @@ impl Service {
|
|||
) -> Result<()> {
|
||||
let destination = Destination::Push(user.to_owned(), pushkey);
|
||||
let event_type = SendingEventType::Pdu(pdu_id.to_owned());
|
||||
let keys = self.db.queue_requests(&[(&destination, &event_type)])?;
|
||||
let key = self
|
||||
.db
|
||||
.queue_requests(&[(&destination, &event_type)])?
|
||||
.into_iter()
|
||||
.next()
|
||||
.unwrap();
|
||||
self.sender
|
||||
.send(RequestData {
|
||||
destination,
|
||||
event_type,
|
||||
key: keys.into_iter().next().unwrap(),
|
||||
key,
|
||||
requester_span: Span::current(),
|
||||
})
|
||||
.unwrap();
|
||||
|
|
@ -630,12 +635,17 @@ impl Service {
|
|||
) -> Result<()> {
|
||||
let destination = Destination::Normal(server.to_owned());
|
||||
let event_type = SendingEventType::Edu(serialized);
|
||||
let keys = self.db.queue_requests(&[(&destination, &event_type)])?;
|
||||
let key = self
|
||||
.db
|
||||
.queue_requests(&[(&destination, &event_type)])?
|
||||
.into_iter()
|
||||
.next()
|
||||
.unwrap();
|
||||
self.sender
|
||||
.send(RequestData {
|
||||
destination,
|
||||
event_type,
|
||||
key: keys.into_iter().next().unwrap(),
|
||||
key,
|
||||
requester_span: Span::current(),
|
||||
})
|
||||
.unwrap();
|
||||
|
|
@ -651,12 +661,17 @@ impl Service {
|
|||
) -> Result<()> {
|
||||
let destination = Destination::Appservice(appservice_id);
|
||||
let event_type = SendingEventType::Pdu(pdu_id);
|
||||
let keys = self.db.queue_requests(&[(&destination, &event_type)])?;
|
||||
let key = self
|
||||
.db
|
||||
.queue_requests(&[(&destination, &event_type)])?
|
||||
.into_iter()
|
||||
.next()
|
||||
.unwrap();
|
||||
self.sender
|
||||
.send(RequestData {
|
||||
destination,
|
||||
event_type,
|
||||
key: keys.into_iter().next().unwrap(),
|
||||
key,
|
||||
requester_span: Span::current(),
|
||||
})
|
||||
.unwrap();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue