-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mentions): Unify mention support local/server
Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
- Loading branch information
1 parent
299319b
commit 638679e
Showing
12 changed files
with
205 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
// | ||
|
||
import Foundation | ||
|
||
@objcMembers public class Mention: NSObject { | ||
|
||
public var id: String | ||
public var label: String | ||
public var mentionId: String? | ||
|
||
init(id: String, label: String) { | ||
self.id = id | ||
self.label = label | ||
} | ||
|
||
init(id: String, label: String, mentionId: String? = nil) { | ||
self.id = id | ||
self.label = label | ||
self.mentionId = mentionId | ||
} | ||
|
||
public var idForChat: String { | ||
// Prefer mentionId if it's supported by the server | ||
let id = self.mentionId ?? self.id | ||
|
||
return "@\"\(id)\"" | ||
} | ||
|
||
public var labelForChat: String { | ||
return "@\(label)" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.