aboutsummaryrefslogtreecommitdiff
path: root/Hotline/iOS
diff options
context:
space:
mode:
authorDustin Mierau <dustin@mierau.me>2024-01-02 19:14:45 -0800
committerDustin Mierau <dustin@mierau.me>2024-01-02 19:15:43 -0800
commit7d670c5b63db44e32d33b7db3495b4d792866f86 (patch)
tree0daff89e0cdac7e6becbc01f00d268e66f2849b6 /Hotline/iOS
parent78a93e5f5ed74010a130367d27221b2a11fb6542 (diff)
Fix banners not loading. First crack at adding a classic icon set with icons painsakenly pulled from the original Hotline client. May try to "remaster" these somehow.
Diffstat (limited to 'Hotline/iOS')
-rw-r--r--Hotline/iOS/ChatView.swift37
-rw-r--r--Hotline/iOS/TrackerView.swift8
2 files changed, 25 insertions, 20 deletions
diff --git a/Hotline/iOS/ChatView.swift b/Hotline/iOS/ChatView.swift
index 02fd6dc..dadd5e6 100644
--- a/Hotline/iOS/ChatView.swift
+++ b/Hotline/iOS/ChatView.swift
@@ -26,25 +26,28 @@ struct ChatView: View {
if msg.type == .agreement {
VStack(alignment: .center) {
- FileImageView()
- .environment(self.model)
- .frame(maxWidth: 468.0)
- .clipShape(RoundedRectangle(cornerRadius: 5))
+ if let bannerImage = self.model.bannerImage {
+ Image(uiImage: bannerImage)
+ .resizable()
+ .scaledToFit()
+ .frame(maxWidth: 468.0)
+ .clipShape(RoundedRectangle(cornerRadius: 5))
+ }
- VStack(alignment: .leading) {
- HStack {
- Text(msg.text)
- .textSelection(.enabled)
- .font(.system(size: 12))
- .fontDesign(.monospaced)
- .lineSpacing(2)
- .padding()
- Spacer()
- }
+ VStack(alignment: .leading) {
+ HStack {
+ Text(msg.text)
+ .textSelection(.enabled)
+ .font(.system(size: 12))
+ .fontDesign(.monospaced)
+ .lineSpacing(2)
+ .padding()
+ Spacer()
}
- .background(colorScheme == .dark ? Color(white: 0.1) : Color(white: 0.96))
- .frame(maxWidth: .infinity)
- .cornerRadius(5)
+ }
+ .background(colorScheme == .dark ? Color(white: 0.1) : Color(white: 0.96))
+ .frame(maxWidth: .infinity)
+ .cornerRadius(5)
}
.frame(maxWidth: .infinity)
.padding()
diff --git a/Hotline/iOS/TrackerView.swift b/Hotline/iOS/TrackerView.swift
index 3339de4..2c0fac4 100644
--- a/Hotline/iOS/TrackerView.swift
+++ b/Hotline/iOS/TrackerView.swift
@@ -86,7 +86,7 @@ struct TrackerConnectView: View {
)
.cornerRadius(10.0)
Button {
- let s = Server(name: nil, description: nil, address: address, port: Server.defaultPort, users: 0)
+ let s = Server(name: nil, description: nil, address: address, port: HotlinePorts.DefaultServerPort, users: 0)
server = s
self.model.login(server: s, login: login, password: password, username: "bolt", iconID: 128) { success in
if !success {
@@ -299,6 +299,7 @@ struct TrackerView: View {
else {
self.model.sendUserInfo(username: "bolt", iconID: 128)
self.model.getUserList()
+ self.model.downloadBanner()
}
}
}
@@ -386,18 +387,19 @@ struct TrackerView: View {
if let address = url.host() {
let login = url.user(percentEncoded: false) ?? ""
let password = url.password(percentEncoded: false) ?? ""
- let port = url.port ?? Server.defaultPort
+ let port = url.port ?? HotlinePorts.DefaultServerPort
self.model.disconnect()
let tempServer = Server(name: nil, description: nil, address: address, port: port, users: 0)
- self.model.login(server: tempServer, login: "", password: "", username: "bolt", iconID: 128) { success in
+ self.model.login(server: tempServer, login: login, password: password, username: "bolt", iconID: 128) { success in
if !success {
print("FAILED LOGIN??")
}
else {
self.model.sendUserInfo(username: "bolt", iconID: 128)
self.model.getUserList()
+ self.model.downloadBanner()
}
}