Skip to content

Commit

Permalink
code improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
Velin92 committed Aug 17, 2023
1 parent d245259 commit e603e60
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/matrix-org/emojibase-bindings",
"state" : {
"revision" : "603693b5909e98e9a616420cbdf7a357828ab030",
"version" : "1.0.0"
"revision" : "6ca06fefac9329fece851a2a4df7979b1699970a",
"version" : "1.0.5"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions ElementX/Sources/Other/UserAgentBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import DeviceKit
#endif

final class UserAgentBuilder {
class func makeASCIIUserAgent() -> String? {
makeUserAgent()?.asciified()
class func makeASCIIUserAgent() -> String {
makeUserAgent()?.asciified() ?? "unknown"
}

private class func makeUserAgent() -> String? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class UserSessionStore: UserSessionStoreProtocol {
.basePath(path: baseDirectory.path)
.username(username: credentials.userID)
.homeserverUrl(url: credentials.restorationToken.session.homeserverUrl)
.userAgent(userAgent: UserAgentBuilder.makeASCIIUserAgent() ?? "unknown")
.userAgent(userAgent: UserAgentBuilder.makeASCIIUserAgent())
.serverVersions(versions: ["v1.0", "v1.1", "v1.2", "v1.3", "v1.4", "v1.5"]) // FIXME: Quick and dirty fix for stopping version requests on startup https://github.com/matrix-org/matrix-rust-sdk/pull/1376

do {
Expand Down
2 changes: 1 addition & 1 deletion NSE/Sources/Other/NSEUserSession.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ final class NSEUserSession {
baseClient = try ClientBuilder()
.basePath(path: URL.sessionsBaseDirectory.path)
.username(username: credentials.userID)
.userAgent(userAgent: UserAgentBuilder.makeASCIIUserAgent() ?? "unknown")
.userAgent(userAgent: UserAgentBuilder.makeASCIIUserAgent())
.build()

try baseClient.restoreSession(session: credentials.restorationToken.session)
Expand Down

0 comments on commit e603e60

Please sign in to comment.