The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Rocket.Chat/packages/rocketchat-channel-settings/server/functions/saveRoomTopic.js

16 lines
552 B

import { Meteor } from 'meteor/meteor';
import { Match } from 'meteor/check';
RocketChat.saveRoomTopic = function(rid, roomTopic, user, sendMessage = true) {
if (!Match.test(rid, String)) {
throw new Meteor.Error('invalid-room', 'Invalid room', {
function: 'RocketChat.saveRoomTopic',
});
}
const update = RocketChat.models.Rooms.setTopicById(rid, roomTopic);
if (update && sendMessage) {
RocketChat.models.Messages.createRoomSettingsChangedWithTypeRoomIdMessageAndUser('room_changed_topic', rid, roomTopic, user);
}
return update;
};