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
445b6db8
Commit
445b6db8
authored
Feb 05, 2018
by
Leonardo Aramaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pin message action
parent
f4ea66f8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
4 deletions
+16
-4
ChatRoomPresenter.kt
...rocket/android/chatroom/presentation/ChatRoomPresenter.kt
+11
-0
ChatRoomAdapter.kt
...n/java/chat/rocket/android/chatroom/ui/ChatRoomAdapter.kt
+1
-0
message_actions.xml
app/src/main/res/menu/message_actions.xml
+4
-4
No files found.
app/src/main/java/chat/rocket/android/chatroom/presentation/ChatRoomPresenter.kt
View file @
445b6db8
...
...
@@ -235,6 +235,17 @@ class ChatRoomPresenter @Inject constructor(private val view: ChatRoomView,
}
}
fun
pinMessage
(
messageId
:
String
)
{
launchUI
(
strategy
)
{
//TODO: Check permissions.
try
{
client
.
pinMessage
(
messageId
)
}
catch
(
e
:
RocketChatException
)
{
Timber
.
e
(
e
)
}
}
}
private
suspend
fun
listenMessages
(
roomId
:
String
)
{
launch
(
CommonPool
+
strategy
.
jobs
)
{
for
(
message
in
client
.
messagesChannel
)
{
...
...
app/src/main/java/chat/rocket/android/chatroom/ui/ChatRoomAdapter.kt
View file @
445b6db8
...
...
@@ -115,6 +115,7 @@ class ChatRoomAdapter(private val serverUrl: String,
R
.
id
.
action_menu_msg_reply
->
presenter
.
citeMessage
(
serverUrl
,
roomType
,
roomName
,
id
,
""
,
true
)
R
.
id
.
action_menu_msg_copy
->
presenter
.
copyMessage
(
id
)
R
.
id
.
action_menu_msg_edit
->
presenter
.
editMessage
(
roomId
,
id
,
getOriginalMessage
())
R
.
id
.
action_menu_msg_pin
->
presenter
.
pinMessage
(
id
)
else
->
TODO
(
"Not implemented"
)
}
}
...
...
app/src/main/res/menu/message_actions.xml
View file @
445b6db8
...
...
@@ -27,10 +27,10 @@
<!--android:icon="@drawable/ic_share_black_24px"-->
<!--android:title="@string/action_msg_share" />-->
<
!--<item-->
<!--android:id="@+id/action_menu_msg_pin"-->
<!--android:icon="@drawable/ic_pin_black_24dp"-->
<!--android:title="@string/action_msg_pin" />--
>
<
item
android:id=
"@+id/action_menu_msg_pin"
android:icon=
"@drawable/ic_pin_black_24dp"
android:title=
"@string/action_msg_pin"
/
>
<!--<item-->
<!--android:id="@+id/action_menu_msg_star"-->
...
...
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