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

[NEW] Add support to Broadcast rooms #1657

Merged
merged 18 commits into from
May 14, 2018
Merged

[NEW] Add support to Broadcast rooms #1657

merged 18 commits into from
May 14, 2018

Conversation

rafaelks
Copy link
Contributor

@rafaelks rafaelks commented May 10, 2018

@RocketChat/ios

Closes #1654

Progress

  • Map the property broadcast in a channel/group: now each channel has a property called broadcast. It is a boolean and the default value is false. The value can not be present and the app needs to handle as the default value;
  • Members list must be hidden: when the room have the broadcast property as true, the members list must be hidden. Only visible for admins, moderators and owners of the rooms; (BLOCKED by [NEW] Add REST endpoints channels.roles & groups.roles Rocket.Chat#10607)
  • Normal users can’t send messages: the room is read-only for normal users. If the client already supports read-only rooms, no changes are required.
  • Reply button on each message: each message in a room needs to have a Reply button and when the user taps on the button, it needs to open the DM with the user who sent the message and “quoting” the message link. Example: if the user taps on the reply button on message with identifier abc123 we need to open the DM with this text filled on the text view: .

Demo

2018-05-10 10 06 56

@rafaelks rafaelks added this to the 2.3.1 milestone May 10, 2018
@rafaelks rafaelks requested a review from cardoso May 10, 2018 13:09
@rafaelks rafaelks changed the title [NEW] Add support to Broadcast rooms [WIP][NEW] Add support to Broadcast rooms May 10, 2018
@codecov
Copy link

codecov bot commented May 10, 2018

Codecov Report

Merging #1657 into develop will increase coverage by 0.06%.
The diff coverage is 46.62%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1657      +/-   ##
===========================================
+ Coverage    36.65%   36.71%   +0.06%     
===========================================
  Files          298      301       +3     
  Lines        14036    14156     +120     
===========================================
+ Hits          5145     5198      +53     
- Misses        8891     8958      +67
Impacted Files Coverage Δ
...quests/Subscription/SubscriptionFilesRequest.swift 92.85% <ø> (ø) ⬆️
Rocket.Chat/Models/Subscription/Subscription.swift 71.42% <ø> (ø) ⬆️
Rocket.Chat/Models/File.swift 0% <ø> (ø) ⬆️
Rocket.Chat/Views/Cells/Chat/ChatMessageCell.swift 0% <0%> (ø) ⬆️
...llers/Chat/ChatControllerMessageCellProtocol.swift 0% <0%> (ø) ⬆️
...t/Controllers/Chat/ChannelInfoViewController.swift 0% <0%> (ø) ⬆️
...iews/Cells/Chat/ChatMessageActionButtonsView.swift 0% <0%> (ø)
Rocket.Chat/Models/User/User.swift 50% <0%> (-50%) ⬇️
...Auth/AuthViewControllerAuthenticationHandler.swift 0% <0%> (ø) ⬆️
...ket.Chat/Controllers/Chat/ChatViewController.swift 41.26% <100%> (+0.06%) ⬆️
... and 14 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0da410b...e4cea21. Read the comment docs.

@rafaelks rafaelks changed the title [WIP][NEW] Add support to Broadcast rooms [BLOCKED][NEW] Add support to Broadcast rooms May 10, 2018
@@ -10,8 +10,8 @@ import RealmSwift
import SlackTextViewController
import SimpleImageViewer

private typealias NibCellIndentifier = (nibName: String, cellIdentifier: String)
private let kEmptyCellIdentifier = "kEmptyCellIdentifier"
Copy link
Contributor Author

@rafaelks rafaelks May 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to revert this change.

@rafaelks rafaelks changed the title [BLOCKED][NEW] Add support to Broadcast rooms [NEW] Add support to Broadcast rooms May 11, 2018
Copy link
Collaborator

@cardoso cardoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one comment, otherwise it's looking good 👍

@@ -23,7 +23,7 @@ fileprivate extension SubscriptionType {
}
}

class SubscriptionFilesRequest: APIRequest {
final class SubscriptionFilesRequest: APIRequest {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -11,15 +11,17 @@ import Foundation
extension AuthViewController {
internal func handleAuthenticationResponse(_ response: LoginResponse) {
if case let .resource(resource) = response, let error = resource.error {
stopLoading()
DispatchQueue.main.async { [weak self] in
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -0,0 +1,59 @@
//
// SubscriptionRolesRequest.swift
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


extension ChatViewController {

func updateSubscriptionRoles() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would be a good method for SubscriptionsClient, with realm and subscription as parameters, instead of being in the ViewController. This would make it more testable and reusable.

I can do it in another PR if you want.

@cardoso cardoso merged commit 747a6ec into develop May 14, 2018
@rafaelks rafaelks deleted the feature/broadcasts.1654 branch May 14, 2018 20:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants