mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
DROID-3016 Chats | Enhancement | Add space-level chat widget by default (#1784)
This commit is contained in:
parent
a67b03f1d1
commit
7bfab8bfe1
19 changed files with 240 additions and 122 deletions
|
@ -729,8 +729,12 @@ class BlockMiddleware(
|
|||
middleware.spaceDelete(space)
|
||||
}
|
||||
|
||||
override suspend fun createWorkspace(details: Struct): Id = middleware.workspaceCreate(
|
||||
details = details
|
||||
override suspend fun createWorkspace(
|
||||
details: Struct,
|
||||
withChat: Boolean
|
||||
): Id = middleware.workspaceCreate(
|
||||
details = details,
|
||||
withChat = withChat
|
||||
)
|
||||
|
||||
override suspend fun getSpaceConfig(space: Id): Config = middleware.workspaceOpen(
|
||||
|
|
|
@ -1921,10 +1921,11 @@ class Middleware @Inject constructor(
|
|||
}
|
||||
|
||||
@Throws(Exception::class)
|
||||
fun workspaceCreate(details: Struct): Id {
|
||||
fun workspaceCreate(details: Struct, withChat: Boolean): Id {
|
||||
val request = Rpc.Workspace.Create.Request(
|
||||
details = details,
|
||||
useCase = Rpc.Object.ImportUseCase.Request.UseCase.GET_STARTED
|
||||
useCase = Rpc.Object.ImportUseCase.Request.UseCase.GET_STARTED,
|
||||
withChat = withChat
|
||||
)
|
||||
logRequestIfDebug(request)
|
||||
val (response, time) = measureTimedValue { service.workspaceCreate(request) }
|
||||
|
@ -1935,7 +1936,8 @@ class Middleware @Inject constructor(
|
|||
@Throws(Exception::class)
|
||||
fun workspaceOpen(space: Id): Config {
|
||||
val request = Rpc.Workspace.Open.Request(
|
||||
spaceId = space
|
||||
spaceId = space,
|
||||
withChat = true
|
||||
)
|
||||
logRequestIfDebug(request)
|
||||
val (response, time) = measureTimedValue { service.workspaceOpen(request) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue