package com.vayunmathur.communicate.data.rcs /** * FT content-server state for the RCS line: the provisioning watcher (here, * with the line) publishes the carrier's file-transfer HTTP content server, * and the host-side file-transfer glue reads it. Kept in this module so the * watcher never references host repository code. */ object RcsContentServer { /** The carrier FT HTTP content-server URI from provisioning, or null. */ var uri: String? = null /** Pull the FT content-server URI out of RCS config XML (ftHTTPCSURI). */ fun parse(configXml: ByteArray): String? { val xml = configXml.toString(Charsets.UTF_8) return Regex("([^<]+)", RegexOption.IGNORE_CASE).find(xml) ?.groupValues?.getOrNull(1)?.trim()?.takeIf { it.isNotEmpty() } } }