Skip to content
This repository has been archived by the owner on Jun 7, 2020. It is now read-only.

[NEW] Room names with special chars #684

Conversation

falcaoaugustos
Copy link
Contributor

@falcaoaugustos falcaoaugustos commented Sep 20, 2017

@RocketChat/ios

Closes #615

I implemented the settings parameter to allow room names with special chars.

TODO:

  • Tests.

@rafaelks rafaelks added this to the 1.5.0 milestone Sep 21, 2017
@rafaelks
Copy link
Contributor

@falcaoaugustos Looking very good, thanks for your PR! Could you also write a few tests related to the setting and the displayName result? That would be perfect 👌

@rafaelks
Copy link
Contributor

For reference, we have a similar test for this class:

func testSubscriptionDisplayNameHonorNameSettings() {
let settings = AuthSettings()
settings.useUserRealName = true
AuthSettingsManager.shared.internalSettings = settings
// Direct Messages
let directMessage = Subscription()
directMessage.name = "direct.message"
directMessage.fname = "DM"
directMessage.privateType = "d"
XCTAssertEqual(directMessage.displayName(), "DM", "Subscription.displayName() will return fname property")
XCTAssertNotEqual(directMessage.displayName(), "direct.message", "Subscription.displayName() won't return name property")
// Channels
let channel = Subscription()
channel.name = "channel"
channel.fname = "CHANNEL"
channel.privateType = "c"
XCTAssertEqual(channel.displayName(), "channel", "Subscription.displayName() will always return name for channels")
XCTAssertNotEqual(channel.displayName(), "CHANNEL", "Subscription.displayName() will always return name for channels")
// Groups and Private Groups
let group = Subscription()
group.name = "group"
group.fname = "GROUP"
group.privateType = "p"
XCTAssertEqual(group.displayName(), "group", "Subscription.displayName() will always return name for groups")
XCTAssertNotEqual(group.displayName(), "GROUP", "Subscription.displayName() will always return name for groups")

@rafaelks rafaelks self-requested a review September 21, 2017 10:20
@rafaelks rafaelks self-assigned this Sep 21, 2017
@falcaoaugustos
Copy link
Contributor Author

Thank you, I will do it.

@rafaelks
Copy link
Contributor

@falcaoaugustos Looking great! Is this ready to be merged?

@falcaoaugustos
Copy link
Contributor Author

This is ready now. Thank you.

@rafaelks rafaelks merged commit f66ab65 into RocketChat:develop Sep 21, 2017
@falcaoaugustos falcaoaugustos deleted the feature/room_name_with_special_chars.615 branch September 22, 2017 01:00
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants