mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
links in messages
This commit is contained in:
parent
41f4eb510d
commit
81e1b61443
3 changed files with 4 additions and 3 deletions
|
|
@ -1308,7 +1308,6 @@ func textMessageAppPacket(packet: MeshPacket, connectedNode: Int64, context: NSM
|
|||
for match in matches {
|
||||
guard let range = Range(match.range, in: messageText) else { continue }
|
||||
let url = messageText[range]
|
||||
print(match.url?.baseURL)
|
||||
messageWithLink = messageText.replacingOccurrences(of: url, with: "[\(String(match.url?.host ?? "Link"))](\(url))")
|
||||
}
|
||||
newMessage.messagePayload = messageWithLink
|
||||
|
|
|
|||
|
|
@ -61,8 +61,9 @@ struct ChannelMessageList: View {
|
|||
}
|
||||
VStack(alignment: currentUser ? .trailing : .leading) {
|
||||
let markdownText: LocalizedStringKey = LocalizedStringKey.init(message.messagePayload ?? "EMPTY MESSAGE")
|
||||
|
||||
let skyBlue = Color(red: 0.4627, green: 0.8392, blue: 1.0)
|
||||
Text(markdownText)
|
||||
.tint(skyBlue)
|
||||
.padding(10)
|
||||
.foregroundColor(.white)
|
||||
.background(currentUser ? .accentColor : Color(.gray))
|
||||
|
|
|
|||
|
|
@ -62,8 +62,9 @@ struct UserMessageList: View {
|
|||
}
|
||||
VStack(alignment: currentUser ? .trailing : .leading) {
|
||||
let markdownText: LocalizedStringKey = LocalizedStringKey.init(message.messagePayload ?? "EMPTY MESSAGE")
|
||||
|
||||
let skyBlue = Color(red: 0.4627, green: 0.8392, blue: 1.0)
|
||||
Text(markdownText)
|
||||
.tint(skyBlue)
|
||||
.padding(10)
|
||||
.foregroundColor(.white)
|
||||
.background(currentUser ? .accentColor : Color(.gray))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue