Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
0320833d
Unverified
Commit
0320833d
authored
May 29, 2018
by
Rafael Kellermann Streit
Committed by
GitHub
May 29, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1321 from RocketChat/fix/open-dm-with-friend
[FIX] Open DM showing Join Chat button
parents
f30cad53
a09e2c3a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
ChatRoomFragment.kt
.../java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt
+3
-1
ChatRoomsPresenter.kt
...cket/android/chatrooms/presentation/ChatRoomsPresenter.kt
+14
-2
No files found.
app/src/main/java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt
View file @
0320833d
...
...
@@ -31,6 +31,8 @@ import chat.rocket.android.helper.KeyboardHelper
import
chat.rocket.android.helper.MessageParser
import
chat.rocket.android.util.extensions.*
import
chat.rocket.android.widget.emoji.*
import
chat.rocket.common.model.RoomType
import
chat.rocket.common.model.roomTypeOf
import
chat.rocket.core.internal.realtime.socket.model.State
import
chat.rocket.core.model.ChatRoom
import
dagger.android.support.AndroidSupportInjection
...
...
@@ -648,7 +650,7 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
if
(
isChatRoomReadOnly
&&
!
canPost
)
{
text_room_is_read_only
.
setVisible
(
true
)
input_container
.
setVisible
(
false
)
}
else
if
(!
isSubscribed
)
{
}
else
if
(!
isSubscribed
&&
roomTypeOf
(
chatRoomType
)
!=
RoomType
.
DIRECT_MESSAGE
)
{
input_container
.
setVisible
(
false
)
button_join_chat
.
setVisible
(
true
)
button_join_chat
.
setOnClickListener
{
presenter
.
joinChat
(
chatRoomId
)
}
...
...
app/src/main/java/chat/rocket/android/chatrooms/presentation/ChatRoomsPresenter.kt
View file @
0320833d
...
...
@@ -34,6 +34,7 @@ import chat.rocket.common.model.SimpleUser
import
chat.rocket.common.model.User
import
chat.rocket.common.util.ifNull
import
chat.rocket.core.internal.model.Subscription
import
chat.rocket.core.internal.realtime.createDirectMessage
import
chat.rocket.core.internal.realtime.socket.model.State
import
chat.rocket.core.internal.realtime.socket.model.StreamMessage
import
chat.rocket.core.internal.realtime.socket.model.Type
...
...
@@ -124,8 +125,19 @@ class ChatRoomsPresenter @Inject constructor(
if
(
myself
?.
username
==
null
)
{
view
.
showMessage
(
R
.
string
.
msg_generic_error
)
}
else
{
val
id
=
if
(
isDirectMessage
&&
!
chatRoom
.
open
)
{
retryIO
(
"createDirectMessage(${chatRoom.name})"
)
{
client
.
createDirectMessage
(
chatRoom
.
name
)
}
val
fromTo
=
mutableListOf
(
myself
.
id
,
chatRoom
.
id
).
apply
{
sort
()
}
fromTo
.
joinToString
(
""
)
}
else
{
chatRoom
.
id
}
val
isChatRoomOwner
=
chatRoom
.
user
?.
username
==
myself
.
username
||
isDirectMessage
navigator
.
toChatRoom
(
chatRoom
.
id
,
roomName
,
navigator
.
toChatRoom
(
id
,
roomName
,
chatRoom
.
type
.
toString
(),
chatRoom
.
readonly
?:
false
,
chatRoom
.
lastSeen
?:
-
1
,
chatRoom
.
open
,
isChatRoomOwner
)
...
...
@@ -210,7 +222,7 @@ class ChatRoomsPresenter @Inject constructor(
}
else
{
null
},
name
=
it
.
name
?:
""
,
name
=
it
.
username
?:
it
.
name
?:
""
,
fullName
=
it
.
name
,
readonly
=
false
,
updatedAt
=
null
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment