Set share info and publish session.updated.
(&mut self, session_id: &str, url: impl Into<String>)
| 900 | |
| 901 | /// Set share info and publish session.updated. |
| 902 | pub fn share(&mut self, session_id: &str, url: impl Into<String>) -> Option<Session> { |
| 903 | let updated = { |
| 904 | let session = self.sessions.get_mut(session_id)?; |
| 905 | session.set_share(SessionShare { url: url.into() }); |
| 906 | session.clone() |
| 907 | }; |
| 908 | self.events.push(SessionEvent::Updated { |
| 909 | info: updated.clone(), |
| 910 | }); |
| 911 | self.publish_session_event(&SESSION_UPDATED_EVENT, &updated); |
| 912 | Some(updated) |
| 913 | } |
| 914 | |
| 915 | /// Clear share info and publish session.updated. |
| 916 | pub fn unshare(&mut self, session_id: &str) -> Option<Session> { |
no test coverage detected