Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
xx messenger iOS
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mobile
iOS
xx messenger iOS
Commits
99a5ec18
Commit
99a5ec18
authored
2 years ago
by
Bruno Muniz
Browse files
Options
Downloads
Patches
Plain Diff
Add success toast to block
parent
8f65cafb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!71
Releasing v1.1.5 (214)
,
!69
Implemented filtering for banned/blocked users and reporting
,
!67
v1.1.5 b(203)
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Sources/ChatFeature/ViewModels/SingleChatViewModel.swift
+8
-0
8 additions, 0 deletions
Sources/ChatFeature/ViewModels/SingleChatViewModel.swift
with
8 additions
and
0 deletions
Sources/ChatFeature/ViewModels/SingleChatViewModel.swift
+
8
−
0
View file @
99a5ec18
...
@@ -8,6 +8,7 @@ import XXModels
...
@@ -8,6 +8,7 @@ import XXModels
import
Foundation
import
Foundation
import
Integration
import
Integration
import
Permissions
import
Permissions
import
ToastFeature
import
DifferenceKit
import
DifferenceKit
import
DependencyInjection
import
DependencyInjection
...
@@ -26,6 +27,7 @@ final class SingleChatViewModel {
...
@@ -26,6 +27,7 @@ final class SingleChatViewModel {
@Dependency
private
var
logger
:
XXLogger
@Dependency
private
var
logger
:
XXLogger
@Dependency
private
var
session
:
SessionType
@Dependency
private
var
session
:
SessionType
@Dependency
private
var
permissions
:
PermissionHandling
@Dependency
private
var
permissions
:
PermissionHandling
@Dependency
private
var
toastController
:
ToastController
var
contact
:
Contact
{
contactSubject
.
value
}
var
contact
:
Contact
{
contactSubject
.
value
}
private
var
stagedReply
:
Reply
?
private
var
stagedReply
:
Reply
?
...
@@ -226,6 +228,12 @@ final class SingleChatViewModel {
...
@@ -226,6 +228,12 @@ final class SingleChatViewModel {
var
contact
=
contact
var
contact
=
contact
contact
.
isBlocked
=
true
contact
.
isBlocked
=
true
_
=
try
?
session
.
dbManager
.
saveContact
(
contact
)
_
=
try
?
session
.
dbManager
.
saveContact
(
contact
)
let
name
=
(
contact
.
nickname
??
contact
.
username
)
??
""
toastController
.
enqueueToast
(
model
:
.
init
(
title
:
"Your report has been sent and
\(
name
)
is now blocked."
,
leftImage
:
Asset
.
requestSentToaster
.
image
))
}
}
func
showRoundFrom
(
_
roundURL
:
String
?)
{
func
showRoundFrom
(
_
roundURL
:
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