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
e70c992e
Commit
e70c992e
authored
3 years ago
by
Bruno Muniz
Browse files
Options
Downloads
Patches
Plain Diff
Fixes stringified facts from verification
parent
5fac939e
No related branches found
No related tags found
2 merge requests
!8
Fixing failed verification due to wrong fact passed
,
!5
Hotfix stringified verification
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Sources/Integration/Session/Session+Contacts.swift
+12
-1
12 additions, 1 deletion
Sources/Integration/Session/Session+Contacts.swift
Sources/Models/FactType.swift
+13
-0
13 additions, 0 deletions
Sources/Models/FactType.swift
with
25 additions
and
1 deletion
Sources/Integration/Session/Session+Contacts.swift
+
12
−
1
View file @
e70c992e
...
@@ -70,11 +70,22 @@ extension Session {
...
@@ -70,11 +70,22 @@ extension Session {
let
ud
=
client
.
userDiscovery
!
let
ud
=
client
.
userDiscovery
!
guard
let
fact
=
contact
.
email
??
contact
.
phone
else
{
let
hasEmail
=
contact
.
email
!=
nil
let
hasPhone
=
contact
.
phone
!=
nil
guard
hasEmail
||
hasPhone
else
{
ud
.
lookup
(
forUserId
:
contact
.
userId
,
resultClosure
)
ud
.
lookup
(
forUserId
:
contact
.
userId
,
resultClosure
)
return
return
}
}
var
fact
:
String
if
hasEmail
{
fact
=
"
\(
FactType
.
email
.
prefix
)\(
contact
.
email
!
)
"
}
else
{
fact
=
"
\(
FactType
.
phone
.
prefix
)\(
contact
.
phone
!
)
"
}
do
{
do
{
try
ud
.
search
(
fact
:
fact
,
resultClosure
)
try
ud
.
search
(
fact
:
fact
,
resultClosure
)
}
catch
{
}
catch
{
...
...
This diff is collapsed.
Click to expand it.
Sources/Models/FactType.swift
+
13
−
0
View file @
e70c992e
...
@@ -18,4 +18,17 @@ public enum FactType: Int {
...
@@ -18,4 +18,17 @@ public enum FactType: Int {
return
"Username"
return
"Username"
}
}
}
}
public
var
prefix
:
String
{
switch
self
{
case
.
email
:
return
"E"
case
.
nickname
:
return
"N"
case
.
phone
:
return
"P"
case
.
username
:
return
"U"
}
}
}
}
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