Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-client-android
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-client-android
Commits
f7f5a7ce
Commit
f7f5a7ce
authored
Dec 9, 2022
by
Amirhossein Naghshzan
Committed by
Adrien Béraud
Dec 12, 2022
Browse files
Options
Downloads
Patches
Plain Diff
ConversationActionsFragment: add unblock option on contact detail page
Change-Id: I11498d74d9507252802185abcbe7ba34f7183c18
parent
c23f0148
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ring-android/app/src/main/java/cx/ring/fragments/ConversationActionsFragment.kt
+29
-13
29 additions, 13 deletions
...ain/java/cx/ring/fragments/ConversationActionsFragment.kt
ring-android/app/src/main/res/values/strings.xml
+4
-0
4 additions, 0 deletions
ring-android/app/src/main/res/values/strings.xml
with
33 additions
and
13 deletions
ring-android/app/src/main/java/cx/ring/fragments/ConversationActionsFragment.kt
+
29
−
13
View file @
f7f5a7ce
...
@@ -152,12 +152,13 @@ class ConversationActionsFragment : Fragment() {
...
@@ -152,12 +152,13 @@ class ConversationActionsFragment : Fragment() {
})
})
}
}
if
(!
contact
.
isBanned
)
{
adapter
.
actions
.
add
(
ContactAction
(
R
.
drawable
.
baseline_block_24
,
getText
(
R
.
string
.
conversation_action_block_this
))
{
adapter
.
actions
.
add
(
ContactAction
(
R
.
drawable
.
baseline_block_24
,
getText
(
R
.
string
.
conversation_action_block_this
))
{
MaterialAlertDialogBuilder
(
requireContext
())
MaterialAlertDialogBuilder
(
requireContext
())
.
setTitle
(
getString
(
R
.
string
.
block_contact_dialog_title
,
conversationUri
))
.
setTitle
(
getString
(
R
.
string
.
block_contact_dialog_title
,
conversationUri
))
.
setMessage
(
getString
(
R
.
string
.
block_contact_dialog_message
,
conversationUri
))
.
setMessage
(
getString
(
R
.
string
.
block_contact_dialog_message
,
conversationUri
))
.
setPositiveButton
(
R
.
string
.
conversation_action_block_this
)
{
_
:
DialogInterface
?,
_
:
Int
->
.
setPositiveButton
(
R
.
string
.
conversation_action_block_this
)
{
_
:
DialogInterface
?,
_
:
Int
->
mAccountService
.
removeContact
(
conversation
.
accountId
,
con
tact
.
uri
.
rawRingId
,
true
)
mConversationFacade
.
banConversation
(
conversation
.
accountId
,
con
versation
.
uri
)
Toast
.
makeText
(
requireContext
(),
getString
(
R
.
string
.
block_contact_completed
,
conversationUri
),
Toast
.
LENGTH_LONG
).
show
()
Toast
.
makeText
(
requireContext
(),
getString
(
R
.
string
.
block_contact_completed
,
conversationUri
),
Toast
.
LENGTH_LONG
).
show
()
requireActivity
().
finish
()
requireActivity
().
finish
()
}
}
...
@@ -165,6 +166,21 @@ class ConversationActionsFragment : Fragment() {
...
@@ -165,6 +166,21 @@ class ConversationActionsFragment : Fragment() {
.
create
()
.
create
()
.
show
()
.
show
()
})
})
}
else
{
adapter
.
actions
.
add
(
ContactAction
(
R
.
drawable
.
baseline_person_add_24
,
getText
(
R
.
string
.
conversation_action_unblock_this
))
{
MaterialAlertDialogBuilder
(
requireContext
())
.
setTitle
(
getString
(
R
.
string
.
unblock_contact_dialog_title
,
conversationUri
))
.
setMessage
(
getString
(
R
.
string
.
unblock_contact_dialog_message
,
conversationUri
))
.
setPositiveButton
(
R
.
string
.
conversation_action_unblock_this
)
{
_
:
DialogInterface
?,
_
:
Int
->
mAccountService
.
addContact
(
conversation
.
accountId
,
contact
.
uri
.
rawRingId
)
Toast
.
makeText
(
requireContext
(),
getString
(
R
.
string
.
unblock_contact_completed
,
conversationUri
),
Toast
.
LENGTH_LONG
).
show
()
requireActivity
().
finish
()
}
.
setNegativeButton
(
android
.
R
.
string
.
cancel
,
null
)
.
create
()
.
show
()
})
}
}
}
...
...
This diff is collapsed.
Click to expand it.
ring-android/app/src/main/res/values/strings.xml
+
4
−
0
View file @
f7f5a7ce
...
@@ -235,6 +235,7 @@ along with this program; if not, write to the Free Software
...
@@ -235,6 +235,7 @@ along with this program; if not, write to the Free Software
<string
name=
"conversation_action_copied_peer_number_clipboard"
>
%1$s copied to clipboard
</string>
<string
name=
"conversation_action_copied_peer_number_clipboard"
>
%1$s copied to clipboard
</string>
<string
name=
"conversation_action_select_peer_number"
>
Select a number
</string>
<string
name=
"conversation_action_select_peer_number"
>
Select a number
</string>
<string
name=
"conversation_action_block_this"
>
Block contact
</string>
<string
name=
"conversation_action_block_this"
>
Block contact
</string>
<string
name=
"conversation_action_unblock_this"
>
Unblock contact
</string>
<string
name=
"conversation_action_go_to_call"
>
Return to ongoing call
</string>
<string
name=
"conversation_action_go_to_call"
>
Return to ongoing call
</string>
<string
name=
"conversation_default_emoji"
translatable=
"false"
>
👍
</string>
<string
name=
"conversation_default_emoji"
translatable=
"false"
>
👍
</string>
<string
name=
"conversation_open_file_error"
>
There is no installed application capable of opening this file type.
</string>
<string
name=
"conversation_open_file_error"
>
There is no installed application capable of opening this file type.
</string>
...
@@ -242,6 +243,9 @@ along with this program; if not, write to the Free Software
...
@@ -242,6 +243,9 @@ along with this program; if not, write to the Free Software
<string
name=
"block_contact_dialog_title"
>
Block %1$s?
</string>
<string
name=
"block_contact_dialog_title"
>
Block %1$s?
</string>
<string
name=
"block_contact_dialog_message"
>
%1$s won\'t be able to contact you until you unblock it.
</string>
<string
name=
"block_contact_dialog_message"
>
%1$s won\'t be able to contact you until you unblock it.
</string>
<string
name=
"block_contact_completed"
>
%1$s was blocked.
</string>
<string
name=
"block_contact_completed"
>
%1$s was blocked.
</string>
<string
name=
"unblock_contact_dialog_title"
>
Unblock %1$s?
</string>
<string
name=
"unblock_contact_dialog_message"
>
%1$s will be able to contact you again.
</string>
<string
name=
"unblock_contact_completed"
>
%1$s was unblocked.
</string>
<string
name=
"conversation_contact_is_typing"
>
Contact is typing…
</string>
<string
name=
"conversation_contact_is_typing"
>
Contact is typing…
</string>
<string
name=
"conversation_info_contact_you"
>
You
</string>
<string
name=
"conversation_info_contact_you"
>
You
</string>
<string
name=
"conversation_members"
>
Members
</string>
<string
name=
"conversation_members"
>
Members
</string>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment