mirror of
https://github.com/binwiederhier/ntfy-android.git
synced 2024-06-14 00:24:34 +12:00
Merge dc7dc667a2
into 1e70ae0d18
This commit is contained in:
commit
0b6e2695f0
|
@ -97,8 +97,13 @@ class DetailActivity : AppCompatActivity(), ActionMode.Callback, NotificationFra
|
|||
return
|
||||
}
|
||||
val secure = url.getBooleanQueryParameter("secure", true)
|
||||
val baseUrl = if (secure) "https://${url.host}" else "http://${url.host}"
|
||||
val topic = url.pathSegments.first()
|
||||
|
||||
val urlWithoutProto = url.fullURL[7:]
|
||||
val lastSlashIndex = urlWithoutProto.lastIndexOf("/")
|
||||
val url2 = urlWithoutProto[:lastSlashIndex]
|
||||
|
||||
val baseUrl = if (secure) "https://${url2}" else "http://${url2}"
|
||||
val topic = urlWithoutProto[lastSlashIndex:]
|
||||
title = topicShortUrl(baseUrl, topic)
|
||||
|
||||
// Subscribe to topic if it doesn't already exist
|
||||
|
|
Loading…
Reference in a new issue