Skip to main content

libsignal_service/websocket/
stickers.rs

1use crate::websocket::{self, SignalWebSocket};
2
3use super::ServiceError;
4
5impl<C: websocket::WebSocketType> SignalWebSocket<C> {
6    pub async fn get_sticker_pack_manifest(
7        &mut self,
8        id: &str,
9    ) -> Result<impl futures::io::AsyncRead + Send + Unpin, ServiceError> {
10        let path = format!("/stickers/{}/manifest.proto", id);
11        Ok(self
12            .unidentified_push_service
13            .get_from_cdn(0, &path)
14            .await?
15            .stream)
16    }
17
18    pub async fn get_sticker(
19        &mut self,
20        pack_id: &str,
21        sticker_id: u32,
22    ) -> Result<impl futures::io::AsyncRead + Send + Unpin, ServiceError> {
23        let path = format!("/stickers/{}/full/{}", pack_id, sticker_id);
24        Ok(self
25            .unidentified_push_service
26            .get_from_cdn(0, &path)
27            .await?
28            .stream)
29    }
30}