mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-05-17 15:59:46 +00:00
minor refactor
This commit is contained in:
parent
236abfa83f
commit
0b1f189e10
@ -140,14 +140,4 @@ proc publishToAny*(
|
|||||||
# TODO: check if it is matches the situation - shall we distinguish client side missing peers from server side?
|
# TODO: check if it is matches the situation - shall we distinguish client side missing peers from server side?
|
||||||
return lighpushErrorResult(NO_PEERS_TO_RELAY, "no suitable remote peers")
|
return lighpushErrorResult(NO_PEERS_TO_RELAY, "no suitable remote peers")
|
||||||
|
|
||||||
let pushRequest = LightpushRequest(
|
return await wl.publish(some(pubSubTopic), message, peer)
|
||||||
requestId: generateRequestId(wl.rng),
|
|
||||||
pubSubTopic: some(pubSubTopic),
|
|
||||||
message: message,
|
|
||||||
)
|
|
||||||
let publishedCount = ?await wl.sendPushRequest(pushRequest, peer)
|
|
||||||
|
|
||||||
for obs in wl.publishObservers:
|
|
||||||
obs.onMessagePublished(pubSubTopic, message)
|
|
||||||
|
|
||||||
return lightpushSuccessResult(publishedCount)
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user