Commit 770dcd4b0c

770dcd4b0c71a44fd45adce415cc8963627c20be

parent: 77786698c4

Unregistered key

vaw <git@nlih.de> · 2026-11-04 04:07 UTC
committer: <noreply@github.com>

Support including other configs (#850)

Layout: unified · split

config.full.toml +10
@@ -7,6 +7,16 @@
77# If you want to start with something simple, use `config.example.toml` and add
88# things in one-by-one as you need them.
99# ==============================================================================
10
11# Include other config files
12include = [
13 # load `~/.config/iamb/config.d/*.toml` in lexicographic order
14 "config.d",
15
16 # override all local settings with values from a global config
17 "/etc/iamb/config.toml"
18]
19
1020default_profile = "default"
1121
1222# Specify a user profile to log in as.
docs/iamb.5 +5
@@ -34,6 +34,11 @@ It's structure and fields are described below.
3434.Sh CONFIGURATION
3535These options are sections at the top-level of the file.
3636.Bl -tag -width Ds
37.It Sy include
38A list of additional toml configs to include. Paths are either absolute or
39relative to the config directory and support shell variable expansion. Configs
40specified later take precedence. If the path is a directory all files ending in
41".toml" are loaded. Transitive includes are not supported.
3742.It Sy profiles
3843A map of profile names containing per-account information.
3944See
src/base.rs +1 −1
@@ -2257,7 +2257,7 @@ impl RoomInfo {
22572257 settings: &ApplicationSettings,
22582258 open_notifications: &mut HashMap<OwnedRoomId, Vec<NotificationHandle>>,
22592259 ) {
2260 let user_id = &settings.profile.user_id;
2260 let user_id = &settings.user_id;
22612261
22622262 let messages = match &thread {
22632263 ReceiptThread::Main => self.get_thread(None),
src/completions.rs +1 −1
@@ -561,7 +561,7 @@ fn complete_iamb_spaces(args: Vec<String>) -> Vec<String> {
561561
562562/// Tab completion for `:logout`
563563fn complete_iamb_logout(args: Vec<String>, store: &ChatStore) -> Vec<String> {
564 let id = store.settings.profile.user_id.as_str();
564 let id = store.settings.user_id.as_str();
565565 match args.len() {
566566 1 if id.starts_with(&args[0]) => vec![id.to_string()],
567567 _ => vec![],
src/config/mod.rs +183 −7
@@ -1,5 +1,6 @@
11//! # Logic for loading and validating application configuration
2use std::collections::HashSet;
2use std::collections::btree_map;
3use std::collections::{HashSet, hash_map};
34use std::env;
45use std::fs::File;
56use std::io::{BufReader, BufWriter, Write as _};
@@ -43,6 +44,16 @@ macro_rules! usage {
4344 }
4445}
4546
47macro_rules! merge_options {
48 ($a: expr, $b: expr) => {
49 match ($a, $b) {
50 (None, None) => None,
51 (Some(v), None) | (None, Some(v)) => Some(v),
52 (Some(a), Some(b)) => Some(a.merge(b)),
53 }
54 };
55}
56
4657lazy_static! {
4758 pub static ref DEFAULT_VIA_SERVER: OwnedServerName = owned_server_name!("matrix.org");
4859}
@@ -252,6 +263,73 @@ fn load_themes(
252263 Ok(themes)
253264}
254265
266/// This must be called before the alternate screen is entered
267fn load_config_includes(mut config: IambConfig, config_dir: &Path) -> IambConfig {
268 for include in std::mem::take(&mut config.include) {
269 let expanded = shellexpand::full(&include)
270 .unwrap_or_else(|err| panic!("unable to expand shell variables in include: {err}"));
271
272 let path = config_dir.join(&*expanded);
273
274 if path.is_dir() {
275 let dir = match path.read_dir() {
276 Ok(dir) => dir,
277 Err(e) => {
278 eprintln!("Unable to read config files in {path:?}: {e}");
279 continue;
280 },
281 };
282
283 // get paths in lexicographic order
284 let mut paths: Vec<_> = dir
285 .flat_map(|entry| {
286 match entry {
287 Ok(file) => Some(file),
288 Err(e) => {
289 eprintln!("Unable to read config file in {path:?}: {e}");
290 None
291 },
292 }
293 })
294 .collect();
295 paths.sort_unstable_by_key(|file| file.file_name());
296
297 for file in paths {
298 let path = file.path();
299 if path.extension().and_then(|e| e.to_str()) != Some("toml") {
300 continue;
301 }
302
303 match IambConfig::load_toml(&path) {
304 Ok(include) => {
305 if !include.include.is_empty() {
306 eprintln!("Ignoring nested includes in {path:?}");
307 }
308 config = include.merge(config);
309 },
310 Err(e) => {
311 eprintln!("Unable to load config file in {path:?}: {e}");
312 },
313 };
314 }
315 } else {
316 match IambConfig::load_toml(&path) {
317 Ok(include) => {
318 if !include.include.is_empty() {
319 eprintln!("Ignoring nested includes in {path:?}");
320 }
321 config = include.merge(config);
322 },
323 Err(e) => {
324 eprintln!("Unable to load config file in {path:?}: {e}");
325 },
326 };
327 }
328 }
329
330 config
331}
332
255333struct IambVersion;
256334
257335impl From<IambVersion> for clap::builder::Str {
@@ -504,6 +582,27 @@ where
504582 }
505583}
506584
585fn merge_macros(profile: Option<Macros>, global: Option<Macros>) -> Option<Macros> {
586 match (global, profile) {
587 (Some(m), None) | (None, Some(m)) => Some(m),
588 (Some(mut global), Some(profile)) => {
589 for (mode, macros) in profile {
590 match global.entry(mode) {
591 hash_map::Entry::Vacant(entry) => {
592 entry.insert(macros);
593 },
594 hash_map::Entry::Occupied(mut entry) => {
595 entry.get_mut().extend(macros);
596 },
597 }
598 }
599
600 Some(global)
601 },
602 (None, None) => None,
603 }
604}
605
507606#[derive(Copy, Clone, Debug, Default, Deserialize, Eq, PartialEq)]
508607#[serde(rename_all = "kebab-case")]
509608#[repr(u8)]
@@ -1376,9 +1475,9 @@ pub enum Layout {
13761475 Config { tabs: Vec<WindowLayout> },
13771476}
13781477
1379#[derive(Clone, Deserialize)]
1478#[derive(Default, Clone, Deserialize)]
13801479pub struct ProfileConfig {
1381 pub user_id: OwnedUserId,
1480 pub user_id: Option<OwnedUserId>,
13821481 pub password_file: Option<PathBuf>,
13831482 pub url: Option<Url>,
13841483 pub settings: Option<Tunables>,
@@ -1389,8 +1488,38 @@ pub struct ProfileConfig {
13891488 pub aliases: Option<Aliases>,
13901489}
13911490
1491impl ProfileConfig {
1492 fn merge(self, other: Self) -> Self {
1493 let user_id = self.user_id.or(other.user_id);
1494 let password_file = self.password_file.or(other.password_file);
1495 let url = self.url.or(other.url);
1496 let settings = merge_options!(self.settings, other.settings);
1497 let theme = merge_options!(self.theme, other.theme);
1498 let dirs = merge_options!(self.dirs, other.dirs);
1499 let layout = self.layout.or(other.layout);
1500 let macros = merge_macros(self.macros, other.macros);
1501 let aliases = merge_maps(self.aliases, other.aliases);
1502
1503 Self {
1504 user_id,
1505 password_file,
1506 url,
1507 settings,
1508 theme,
1509 dirs,
1510 layout,
1511 macros,
1512 aliases,
1513 }
1514 }
1515}
1516
13921517#[derive(Clone, Deserialize)]
13931518pub struct IambConfig {
1519 #[serde(default)]
1520 include: Vec<String>,
1521
1522 #[serde(default)]
13941523 pub profiles: BTreeMap<String, ProfileConfig>,
13951524 pub default_profile: Option<String>,
13961525 pub settings: Option<Tunables>,
@@ -1415,6 +1544,45 @@ impl IambConfig {
14151544
14161545 Ok(config)
14171546 }
1547
1548 /// If a value is present in both configs, `self` is prefered.
1549 fn merge(self, other: Self) -> Self {
1550 // transitive includes are not supported
1551 let include = vec![];
1552
1553 let mut profiles = self.profiles;
1554 for (name, profile) in other.profiles {
1555 match profiles.entry(name) {
1556 btree_map::Entry::Vacant(entry) => {
1557 entry.insert(profile);
1558 },
1559 btree_map::Entry::Occupied(mut entry) => {
1560 let profile = std::mem::take(entry.get_mut()).merge(profile);
1561 entry.insert(profile);
1562 },
1563 }
1564 }
1565
1566 let default_profile = self.default_profile.or(other.default_profile);
1567 let settings = merge_options!(self.settings, other.settings);
1568 let dirs = merge_options!(self.dirs, other.dirs);
1569 let layout = self.layout.or(other.layout);
1570 let macros = merge_macros(self.macros, other.macros);
1571 let aliases = merge_maps(self.aliases, other.aliases);
1572 let theme = merge_options!(self.theme, other.theme);
1573
1574 Self {
1575 include,
1576 profiles,
1577 default_profile,
1578 settings,
1579 dirs,
1580 layout,
1581 macros,
1582 aliases,
1583 theme,
1584 }
1585 }
14181586}
14191587
14201588#[derive(Clone)]
@@ -1427,6 +1595,7 @@ pub struct ApplicationSettings {
14271595 pub sqlite_dir: PathBuf,
14281596 pub sqlite_cache_dir: PathBuf,
14291597 pub profile_name: String,
1598 pub user_id: OwnedUserId,
14301599 pub profile: ProfileConfig,
14311600 pub theme: Arc<theme::ThemeValues>,
14321601 pub themes: Arc<CompletionMap<String, theme::Theme>>,
@@ -1476,6 +1645,8 @@ impl ApplicationSettings {
14761645 );
14771646 };
14781647
1648 let config = load_config_includes(config, &config_dir);
1649
14791650 let IambConfig {
14801651 mut profiles,
14811652 default_profile,
@@ -1485,6 +1656,7 @@ impl ApplicationSettings {
14851656 macros,
14861657 aliases,
14871658 theme,
1659 ..
14881660 } = config;
14891661
14901662 validate_profile_names(&profiles);
@@ -1526,8 +1698,10 @@ impl ApplicationSettings {
15261698 }
15271699 };
15281700
1701 let user_id = profile.user_id.clone().expect("Active profile does not have a user id");
1702
15291703 let aliases = merge_maps(profile.aliases.take(), aliases).unwrap_or_default();
1530 let macros = merge_maps(profile.macros.take(), macros).unwrap_or_default();
1704 let macros = merge_macros(profile.macros.take(), macros).unwrap_or_default();
15311705 let layout = profile.layout.take().or(layout).unwrap_or_default();
15321706
15331707 let tunables = global.unwrap_or_default();
@@ -1600,6 +1774,7 @@ impl ApplicationSettings {
16001774 sqlite_dir,
16011775 sqlite_cache_dir,
16021776 profile_name,
1777 user_id,
16031778 profile,
16041779 themes,
16051780 theme,
@@ -1656,7 +1831,7 @@ impl ApplicationSettings {
16561831 let reader = BufReader::new(file);
16571832 let saved: SavedDevice = serde_json::from_reader(reader).ok()?;
16581833
1659 if saved.is_user(&self.profile.user_id) {
1834 if saved.is_user(&self.user_id) {
16601835 Some(saved)
16611836 } else {
16621837 None
@@ -1674,14 +1849,14 @@ impl ApplicationSettings {
16741849 let saved = match client_id {
16751850 Some(client) => {
16761851 SavedDevice::OAuth {
1677 user_id: self.profile.user_id.clone(),
1852 user_id: self.user_id.clone(),
16781853 device_id: device_id.to_owned(),
16791854 client_id: client,
16801855 }
16811856 },
16821857 None => {
16831858 SavedDevice::MatrixAuth {
1684 user_id: self.profile.user_id.clone(),
1859 user_id: self.user_id.clone(),
16851860 device_id: device_id.to_owned(),
16861861 }
16871862 },
@@ -2327,6 +2502,7 @@ time_format = "%"
23272502 macros,
23282503 aliases,
23292504 theme,
2505 ..
23302506 } = &config;
23312507
23322508 // There should be an example object for each top-level field.
src/main.rs +2 −2
@@ -878,7 +878,7 @@ impl Application {
878878 },
879879 HomeserverAction::ProfileFieldShow(field) => {
880880 let client = &store.application.worker.client;
881 let user_id = store.application.settings.profile.user_id.clone();
881 let user_id = store.application.settings.user_id.clone();
882882 let account = client.account();
883883 let value = account
884884 .fetch_profile_field_of(user_id, field.clone())
@@ -1102,7 +1102,7 @@ async fn login_normal(
11021102 settings: &ApplicationSettings,
11031103 store: &AsyncProgramStore,
11041104) -> IambResult<()> {
1105 println!("* Logging in for {}...", settings.profile.user_id);
1105 println!("* Logging in for {}...", settings.user_id);
11061106 login(worker, settings).await?;
11071107 println!("* Syncing...");
11081108 worker.spawn_sync()?;
src/message/mod.rs +4 −4
@@ -1145,7 +1145,7 @@ impl Message {
11451145 let marker = info
11461146 .user_receipts
11471147 .get(&self.receipt_thread(info))
1148 .and_then(|receipts| receipts.get(&settings.profile.user_id));
1148 .and_then(|receipts| receipts.get(&settings.user_id));
11491149
11501150 is_after_read_marker(prev, marker)
11511151 }
@@ -1213,7 +1213,7 @@ impl Message {
12131213 let unthreaded = info.read_event_users(ReceiptThread::Unthreaded, event_id);
12141214 threaded
12151215 .chain(unthreaded)
1216 .filter(|user_id| **user_id != settings.profile.user_id)
1216 .filter(|user_id| **user_id != settings.user_id)
12171217 .map(|user_id| user_id.to_owned())
12181218 .collect()
12191219 })
@@ -2072,7 +2072,7 @@ pub mod tests {
20722072
20732073 let prev = mock_message1();
20742074 let msg = mock_message2();
2075 let user_id = settings.profile.user_id.clone();
2075 let user_id = settings.user_id.clone();
20762076
20772077 // Without a marker, no trackbar is drawn.
20782078 let text = msg.show(Some(&prev), false, width, &info, &settings, &previews);
@@ -2098,7 +2098,7 @@ pub mod tests {
20982098 fn test_show_trackbar_thread() {
20992099 let settings = mock_settings();
21002100 let mut info = mock_room();
2101 let user_id = settings.profile.user_id.clone();
2101 let user_id = settings.user_id.clone();
21022102
21032103 let prev = mock_message1();
21042104 let msg = mock_message2();
src/tests.rs +2 −1
@@ -228,8 +228,9 @@ pub fn mock_settings() -> ApplicationSettings {
228228 sqlite_cache_dir: PathBuf::new(),
229229
230230 profile_name: "test".into(),
231 user_id: user_id!("@user:example.com").to_owned(),
231232 profile: ProfileConfig {
232 user_id: user_id!("@user:example.com").to_owned(),
233 user_id: Some(user_id!("@user:example.com").to_owned()),
233234 password_file: None,
234235 url: None,
235236 settings: None,
src/util.rs +1 −1
@@ -226,7 +226,7 @@ pub fn setup_tty(settings: &ApplicationSettings) -> std::io::Result<()> {
226226 }
227227
228228 if settings.tunables.terminal.enable_title {
229 let title = format!("iamb ({})", settings.profile.user_id.as_str());
229 let title = format!("iamb ({})", settings.user_id.as_str());
230230 crossterm::execute!(stdout(), SetTitle(title))?;
231231 }
232232
src/windows/room/chat.rs +4 −4
@@ -230,7 +230,7 @@ impl ChatState {
230230 .await
231231 },
232232 MessageAction::Edit => {
233 if msg.sender != settings.profile.user_id {
233 if msg.sender != settings.user_id {
234234 let msg = "Cannot edit messages sent by someone else";
235235 let err = UIError::Failure(msg.into());
236236
@@ -817,7 +817,7 @@ pub async fn msg_react(
817817 MessageEvent::UnstablePoll(ev) => ev.event_id().to_owned(),
818818 };
819819
820 if info.user_reactions_contains(&settings.profile.user_id, &event_id, &emoji) {
820 if info.user_reactions_contains(&settings.user_id, &event_id, &emoji) {
821821 let msg = format!("You’ve already reacted to this message with {emoji}");
822822 let err = UIError::Failure(msg);
823823
@@ -947,7 +947,7 @@ pub async fn msg_unreact(
947947 };
948948
949949 let reactions = reactions.iter().filter_map(|(event_id, (reaction, user_id, _))| {
950 if user_id != &settings.profile.user_id {
950 if user_id != &settings.user_id {
951951 return None;
952952 }
953953
@@ -1000,7 +1000,7 @@ pub async fn msg_pin(
10001000 .await
10011001 .map_err(matrix_sdk::Error::from)
10021002 .map_err(IambError::from)?
1003 .user_can_send_state(&settings.profile.user_id, StateEventType::RoomPinnedEvents);
1003 .user_can_send_state(&settings.user_id, StateEventType::RoomPinnedEvents);
10041004
10051005 if !can_pin {
10061006 return Err(IambError::InsufficientPermission.into());
src/windows/room/message.rs +1 −3
@@ -17,9 +17,7 @@ fn contains_reaction(
1717 .as_origin()
1818 .and_then(|event_id| info.reactions.get(event_id))
1919 .is_some_and(|reacts| {
20 reacts
21 .values()
22 .any(|(k, user, _)| user == &settings.profile.user_id && k == key)
20 reacts.values().any(|(k, user, _)| user == &settings.user_id && k == key)
2321 })
2422}
2523
src/windows/room/mod.rs +1 −1
@@ -599,7 +599,7 @@ pub async fn room_command(
599599 "Cannot show a single alias; use `:room aliases show` instead.".into()
600600 },
601601 RoomField::UserName => {
602 let user_id = &store.application.settings.profile.user_id;
602 let user_id = &store.application.settings.user_id;
603603 let Some(member) = room.get_member(user_id).await.map_err(IambError::from)?
604604 else {
605605 let msg = "Cannot find membership data".into();
src/windows/room/scrollback.rs +2 −2
@@ -1851,7 +1851,7 @@ mod tests {
18511851 let mut store = mock_store().await;
18521852 store.application.settings.tunables.typing_notice_display = false;
18531853
1854 let user_id = store.application.settings.profile.user_id.clone();
1854 let user_id = store.application.settings.user_id.clone();
18551855 store.application.get_room_info(TEST_ROOM1_ID.clone()).set_receipt(
18561856 ReceiptThread::Main,
18571857 user_id,
@@ -1900,7 +1900,7 @@ mod tests {
19001900 // or not it is a private or public receipt that we send to the home server.
19011901 for read_receipt_send in [true, false] {
19021902 let mut store = draw_focused_room(read_receipt_send).await;
1903 let user_id = store.application.settings.profile.user_id.clone();
1903 let user_id = store.application.settings.user_id.clone();
19041904 let info = store.application.get_room_info(TEST_ROOM1_ID.clone());
19051905
19061906 let receipt = info
src/windows/room/space.rs +2 −2
@@ -66,7 +66,7 @@ impl SpaceState {
6666 .map_err(matrix_sdk::Error::from)
6767 .map_err(IambError::from)?
6868 .user_can_send_state(
69 &store.application.settings.profile.user_id,
69 &store.application.settings.user_id,
7070 StateEventType::SpaceChild,
7171 )
7272 {
@@ -117,7 +117,7 @@ impl SpaceState {
117117 .map_err(matrix_sdk::Error::from)
118118 .map_err(IambError::from)?
119119 .user_can_send_state(
120 &store.application.settings.profile.user_id,
120 &store.application.settings.user_id,
121121 StateEventType::SpaceChild,
122122 )
123123 {
src/worker.rs +13 −14
@@ -510,10 +510,10 @@ fn insert_msgs_and_receipts(
510510 // ignoring redaction events because we get them bundled with the redacted event
511511 },
512512 AnyTimelineEvent::MessageLike(AnyMessageLikeEvent::PollStart(ev)) => {
513 info.insert_poll_start(ev, &settings.profile.user_id);
513 info.insert_poll_start(ev, &settings.user_id);
514514 },
515515 AnyTimelineEvent::MessageLike(AnyMessageLikeEvent::UnstablePollStart(ev)) => {
516 info.insert_unstable_poll_start(ev, &settings.profile.user_id);
516 info.insert_unstable_poll_start(ev, &settings.user_id);
517517 },
518518 AnyTimelineEvent::MessageLike(AnyMessageLikeEvent::PollResponse(ev)) => {
519519 if let MessageLikeEvent::Original(ev) = ev {
@@ -1330,8 +1330,7 @@ async fn create_client_inner(
13301330 builder.homeserver_url(url.as_str())
13311331 } else {
13321332 // Try to discover the homeserver from the user ID.
1333 let account = &settings.profile;
1334 builder.server_name(account.user_id.server_name())
1333 builder.server_name(settings.user_id.server_name())
13351334 };
13361335
13371336 builder.build().await
@@ -1341,7 +1340,7 @@ pub async fn create_client(settings: &ApplicationSettings) -> Client {
13411340 let account = &settings.profile;
13421341 let res = match create_client_inner(&account.url, settings).await {
13431342 Err(ClientBuildError::AutoDiscovery(_)) => {
1344 let url = format!("https://{}/", account.user_id.server_name().as_str());
1343 let url = format!("https://{}/", settings.user_id.server_name().as_str());
13451344 let url = Url::parse(&url).unwrap();
13461345 create_client_inner(&Some(url), settings).await
13471346 },
@@ -1675,7 +1674,7 @@ impl ClientWorker {
16751674 .content
16761675 .user_ids
16771676 .into_iter()
1678 .filter(|u| u != &locked.application.settings.profile.user_id)
1677 .filter(|u| u != &locked.application.settings.user_id)
16791678 .collect();
16801679
16811680 locked.application.get_room_info(room_id).set_typing(users);
@@ -1869,7 +1868,7 @@ impl ClientWorker {
18691868 let info = rooms.get_or_default(room_id.to_owned());
18701869
18711870 let full_ev = ev.into_full_event(room_id.to_owned());
1872 info.insert_poll_start(full_ev, &settings.profile.user_id);
1871 info.insert_poll_start(full_ev, &settings.user_id);
18731872
18741873 update_event_receipts(info, &room, event_id).await;
18751874 }
@@ -1894,7 +1893,7 @@ impl ClientWorker {
18941893 let info = rooms.get_or_default(room_id.to_owned());
18951894
18961895 let full_ev = ev.into_full_event(room_id.to_owned());
1897 info.insert_unstable_poll_start(full_ev, &settings.profile.user_id);
1896 info.insert_unstable_poll_start(full_ev, &settings.user_id);
18981897
18991898 update_event_receipts(info, &room, event_id).await;
19001899 }
@@ -2189,7 +2188,7 @@ impl ClientWorker {
21892188 LoginStyle::Password(password) => {
21902189 let mut login = client
21912190 .matrix_auth()
2192 .login_username(&self.settings.profile.user_id, &password)
2191 .login_username(&self.settings.user_id, &password)
21932192 .initial_device_display_name(initial_devname().as_str());
21942193 if let Some(device) = self.settings.read_saved_device() {
21952194 login = login.device_id(device.device_id().as_str());
@@ -2224,7 +2223,7 @@ impl ClientWorker {
22242223 LoginStyle::OAuth => {
22252224 oauth_login(
22262225 self.client.clone(),
2227 &self.settings.profile.user_id,
2226 &self.settings.user_id,
22282227 self.settings.read_saved_device(),
22292228 )
22302229 .await?;
@@ -2241,7 +2240,7 @@ impl ClientWorker {
22412240
22422241 async fn logout(&mut self, user_id: String) -> IambResult<EditInfo> {
22432242 // Verify that the user is logging out of the correct profile.
2244 let curr = self.settings.profile.user_id.as_str();
2243 let curr = self.settings.user_id.as_str();
22452244
22462245 if user_id != curr {
22472246 let msg = format!("Incorrect user ID (currently logged in as {curr})");
@@ -2406,12 +2405,12 @@ impl ClientWorker {
24062405 };
24072406
24082407 let msg = format!("* Successfully logged in with {}!", user);
2409 if user != self.settings.profile.user_id {
2408 if user != self.settings.user_id {
24102409 // Trace warning if this happens
24112410 tracing::warn!("logged in as a different user than expected");
2412 self.settings.profile.user_id = user.to_owned();
2411 self.settings.user_id = user.to_owned();
24132412 let store = self.store.as_ref().expect("initialised worker should have store");
2414 store.lock().await.application.settings.profile.user_id = user.to_owned();
2413 store.lock().await.application.settings.user_id = user.to_owned();
24152414 }
24162415 Ok(Some(InfoMessage::from(msg)))
24172416 }