Skip to content
This repository was archived by the owner on Oct 30, 2025. It is now read-only.

[NEW] Add Endpoints for Owner, leader, moderator of a group/channel - #235

Merged
philipbrito merged 5 commits into
RocketChat:developfrom
shubhsherl:n_1958
Jul 10, 2019
Merged

[NEW] Add Endpoints for Owner, leader, moderator of a group/channel#235
philipbrito merged 5 commits into
RocketChat:developfrom
shubhsherl:n_1958

Conversation

@shubhsherl

Copy link
Copy Markdown
Contributor

Add Endpoints for Add/Delete Owner, Leader and Moderator of a group/channel.

@shubhsherl

Copy link
Copy Markdown
Contributor Author

@filipedelimabrito Can you please review this PR. Required for a PR in RC.Android

@philipbrito philipbrito left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@shubhsherl Can you work on the suggestions made here?

/* Add owner of a Channel/Group
* @param roomId Id of the room.
* @param roomType The type of the room.
*/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To be completely documented, it is missing the @param for userId used here.

* @param roomId Id of the room.
* @param roomType The type of the room.
*/
suspend fun RocketChatClient.addLeader(roomId: String ,roomType: RoomType, userId: String) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To be completely documented, it is missing the @param for userId used here.

* @param roomId Id of the room.
* @param roomType The type of the room.
*/
suspend fun RocketChatClient.addModerator(roomId: String ,roomType: RoomType, userId: String) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To be completely documented, it is missing the @param for userId used here.

* @param roomId Id of the room.
* @param roomType The type of the room.
*/
suspend fun RocketChatClient.removeOwner(roomId: String ,roomType: RoomType, userId: String) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To be completely documented, it is missing the @param for userId used here.

* @param roomId Id of the room.
* @param roomType The type of the room.
*/
suspend fun RocketChatClient.removeLeader(roomId: String ,roomType: RoomType, userId: String) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To be completely documented, it is missing the @param for userId used here.

* @param roomId Id of the room.
* @param roomType The type of the room.
*/
suspend fun RocketChatClient.removeModerator(roomId: String ,roomType: RoomType, userId: String) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To be completely documented, it is missing the @param for userId used here.

* Ignore User
* @param roomId Id of the room.
* @param userId Id of user to remove from room.
* @param ignore user.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I believe we can improve the documentation here.

* @param userId Id of user to remove from room.
* @param ignore user.
*/
suspend fun RocketChatClient.ignoreUser(roomId: String , userId: String, ignore: Boolean = true): Boolean =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we can move this function to ChatRoom class. Actually there is no reason to keep ChatRoom.kt and Channel.kt on our code. ChatRoom.kt is enough.

data class ChatRoomUserIgnorePayload(@Json(name = "rid") val roomId: String, val userId: String, val ignore: Boolean)

@JsonSerializable
data class ChatRoomUserPayload(val roomId: String, val userId: String)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Isn't the json name for the roomId parameter rid?

data class ChatRoomUserPayload(val roomId: String, val userId: String)

@JsonSerializable
data class ChatRoomNamePayload(val roomId: String, val name: String?)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Isn't the json name for the roomId parameter rid?

@philipbrito philipbrito changed the title Add Endpoint for Owner, leader, moderator [NEW] Add Endpoints for Owner, leader, moderator of a group/channel Jun 18, 2019

@philipbrito philipbrito left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for sending this PR @shubhsherl. I have fixed the requested changes here.

@philipbrito
philipbrito merged commit 570f3dd into RocketChat:develop Jul 10, 2019
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