(context: &Context)
| 793 | } |
| 794 | |
| 795 | async fn get_securejoin_source_stats(context: &Context) -> Result<SecurejoinSources> { |
| 796 | let map: BTreeMap<SecurejoinSource, u32> = context |
| 797 | .sql |
| 798 | .query_map_collect( |
| 799 | "SELECT source, count FROM stats_securejoin_sources", |
| 800 | (), |
| 801 | |row| { |
| 802 | let source: SecurejoinSource = row.get(0)?; |
| 803 | let count: u32 = row.get(1)?; |
| 804 | Ok((source, count)) |
| 805 | }, |
| 806 | ) |
| 807 | .await?; |
| 808 | |
| 809 | let stats = SecurejoinSources { |
| 810 | unknown: *map.get(&SecurejoinSource::Unknown).unwrap_or(&0), |
| 811 | external_link: *map.get(&SecurejoinSource::ExternalLink).unwrap_or(&0), |
| 812 | internal_link: *map.get(&SecurejoinSource::InternalLink).unwrap_or(&0), |
| 813 | clipboard: *map.get(&SecurejoinSource::Clipboard).unwrap_or(&0), |
| 814 | image_loaded: *map.get(&SecurejoinSource::ImageLoaded).unwrap_or(&0), |
| 815 | scan: *map.get(&SecurejoinSource::Scan).unwrap_or(&0), |
| 816 | }; |
| 817 | |
| 818 | Ok(stats) |
| 819 | } |
| 820 | |
| 821 | async fn get_securejoin_uipath_stats(context: &Context) -> Result<SecurejoinUiPaths> { |
| 822 | let map: BTreeMap<SecurejoinUiPath, u32> = context |
no test coverage detected