Skip to content

Commit 2146cd0

Browse files
committed
Use Bundle.appVersion for GMCP hello and about screen version strings.
1 parent 297bd57 commit 2146cd0

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import Foundation
2+
3+
extension Bundle {
4+
@objc var appVersion: String {
5+
let short = infoDictionary?["CFBundleShortVersionString"] as? String ?? "0.0.0"
6+
let build = infoDictionary?["CFBundleVersion"] as? String ?? "0"
7+
return "\(short).\(build)"
8+
}
9+
}

src/Mudrammer/Additions/UIApplication+Additions.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//
88

99
#import "UIApplication+Additions.h"
10-
#import <UIApplication+SSAdditions.h>
10+
#import "Wammer-Swift.h"
1111

1212
@implementation UIApplication (Additions)
1313

@@ -32,8 +32,8 @@ + (NSString *)applicationFullAbout {
3232
];
3333
});
3434

35-
return [NSString stringWithFormat:@"%@\n\n%@",
36-
[UIApplication applicationNameVersionBuild],
35+
return [NSString stringWithFormat:@"Wammer %@\n\n%@",
36+
[NSBundle mainBundle].appVersion,
3737
extras[arc4random_uniform((uint32_t)[extras count])]];
3838
}
3939

src/Mudrammer/Network/SSMUDSocket.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ extension SSMUDSocket: TelnetClientDelegate {
213213
func onGMCPNegotiated() {
214214
telnetSession?.sendGMCP(
215215
module: "Core.Hello",
216-
json: "{\"client\":\"Wammer\",\"version\":\"1.0.1\"}"
216+
json: "{\"client\":\"Wammer\",\"version\":\"\(Bundle.main.appVersion)\"}"
217217
)
218218
}
219219

0 commit comments

Comments
 (0)