Skip to content
Snippets Groups Projects
Commit e2359539 authored by Taras's avatar Taras
Browse files

Change url building

parent 17fe0e82
No related branches found
No related tags found
No related merge requests found
package org.futo.circles.core.feature.share package org.futo.circles.core.feature.share
import org.futo.circles.core.provider.MatrixSessionProvider import org.futo.circles.core.model.ShareUrlTypeArg
private const val BASE_SHARE_URL = "https://circu.li/" private const val BASE_SHARE_URL = "https://circu.li/"
const val SHARE_ROOM_URL_PREFIX = "https://circu.li/room/"
const val SHARE_PROFILE_URL_PREFIX = "https://circu.li/profile/"
fun buildShareRoomUrl(roomId: String, roomName: String, topic: String?) = fun buildShareRoomUrl(type: ShareUrlTypeArg, roomId: String) =
SHARE_ROOM_URL_PREFIX + roomId + "/$roomName" + if (topic.isNullOrEmpty()) "" else "/$topic" BASE_SHARE_URL + type.typeKey + "/$roomId"
fun buildShareProfileUrl(sharedSpaceId: String) =
MatrixSessionProvider.currentSession?.myUserId?.let { userId ->
"$SHARE_PROFILE_URL_PREFIX$userId/$sharedSpaceId"
} ?: ""
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment