Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ class NotificationActivity : BaseActivity() {
val n = container.notification!!
markReadItems(listOf(container), markUnread = false, fromUndoOrClick = true, position = itemPosition)
n.contents?.links?.getPrimary()?.let { link ->
val url = link.url
val url = link.encodedUrl
if (url.isNotEmpty()) {
linkHandler.wikiSite = WikiSite(url)
linkHandler.onUrlClick(url, null, "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ object NotificationPresenter {
}

private fun addActionForDiffLink(context: Context, builder: NotificationCompat.Builder, link: Notification.Link, n: Notification) {
val uri = Uri.parse(link.url)
val uri = Uri.parse(link.encodedUrl)
val title = uri.getQueryParameter("title")
val oldRev = uri.getQueryParameter("prev").orEmpty().toLongOrNull() ?: -1
val newRev = uri.getQueryParameter("diff").orEmpty().toLongOrNull() ?: -1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,18 @@ class Notification(var id: Long = 0,
private val description: String = ""
var url: String = ""
private set
var encodedUrl: String = ""
private set
val label: String = ""
val tooltip: String = ""
// The icon could be a string or `false`.
private val icon: JsonElement? = null

init {
encodedUrl = url
if (encodedUrl.startsWith("//")) {
encodedUrl = WikiSite.DEFAULT_SCHEME + "://" + encodedUrl.substring(2)
}
url = UriUtil.decodeURL(url)
if (url.startsWith("//")) {
url = url.replaceFirst("//", WikiSite.DEFAULT_SCHEME + "://")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class NotificationActionsOverflowView(context: Context) : FrameLayout(context) {

private var actionClickListener = OnClickListener {
val link = it.tag as Notification.Link
val url = link.url
val url = link.encodedUrl
val notification = container.notification
if (url.isNotEmpty() && notification != null) {
linkHandler.wikiSite = WikiSite(url)
Expand Down