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
30292513
Commit
30292513
authored
2 years ago
by
Bruno Muniz
Browse files
Options
Downloads
Patches
Plain Diff
Show ban warning after fetching/processing banned list
parent
88f47a45
No related branches found
No related tags found
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
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Sources/LaunchFeature/LaunchViewModel.swift
+11
-0
11 additions, 0 deletions
Sources/LaunchFeature/LaunchViewModel.swift
Sources/ReportingFeature/Resources/report_cert.der
+0
-0
0 additions, 0 deletions
Sources/ReportingFeature/Resources/report_cert.der
with
11 additions
and
0 deletions
Sources/LaunchFeature/LaunchViewModel.swift
+
11
−
0
View file @
30292513
...
...
@@ -8,6 +8,7 @@ import Keychain
import
Foundation
import
Integration
import
Permissions
import
ToastFeature
import
DropboxFeature
import
VersionChecking
import
ReportingFeature
...
...
@@ -36,6 +37,7 @@ final class LaunchViewModel {
@Dependency
private
var
permissionHandler
:
PermissionHandling
@Dependency
private
var
fetchBannedList
:
FetchBannedList
@Dependency
private
var
processBannedList
:
ProcessBannedList
@Dependency
private
var
toastController
:
ToastController
@Dependency
private
var
session
:
SessionType
@KeyObject
(
.
username
,
defaultValue
:
nil
)
var
username
:
String
?
...
...
@@ -224,6 +226,7 @@ final class LaunchViewModel {
if
contact
.
isBanned
==
false
{
contact
.
isBanned
=
true
try!
self
.
session
.
dbManager
.
saveContact
(
contact
)
self
.
enqueueBanWarning
(
contact
:
contact
)
}
}
else
{
try!
self
.
session
.
dbManager
.
saveContact
(
.
init
(
id
:
userId
,
isBanned
:
true
))
...
...
@@ -246,4 +249,12 @@ final class LaunchViewModel {
}
)
}
private
func
enqueueBanWarning
(
contact
:
Contact
)
{
let
name
=
(
contact
.
nickname
??
contact
.
username
)
??
"One of your contacts"
toastController
.
enqueueToast
(
model
:
.
init
(
title
:
"
\(
name
)
has been banned for offensive content."
,
leftImage
:
Asset
.
requestSentToaster
.
image
))
}
}
This diff is collapsed.
Click to expand it.
Sources/ReportingFeature/Resources/report_cert.der
+
0
−
0
View file @
30292513
No preview for this file type
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