<commit_before>Template.membersList.helpers
	tAddUsers: ->
		return t('Add_users')

	isGroupChat: ->
		return ChatRoom.findOne(this.rid, { reactive: false })?.t in ['c', 'p']

	isDirectChat: ->
		return ChatRoom.findOne(this.rid, { reactive: false })?.t is 'd'

	seeAll: ->
		if Template.instance().showAllUsers.get()
			return t('Show_only_online')
		else
			return t('Show_all')

	roomUsers: ->
		onlineUsers = RoomManager.onlineUsers.get()
		room = ChatRoom.findOne(this.rid)
		roomUsernames = room?.usernames or []
		roomOnlineUsernames = roomUsernames.filter((username) -> onlineUsers[username])
		roomMuted = room?.muted or []

		if Template.instance().showAllUsers.get()
			usernames = roomUsernames
		else
			usernames = roomOnlineUsernames

		users = usernames.map (username) ->
			utcOffset = onlineUsers[username]?.utcOffset

			if utcOffset?
				if utcOffset > 0
					utcOffset = "+#{utcOffset}"
				utcOffset = "(UTC #{utcOffset})"
			user = Meteor.users.findOne({username:username})

			return {
				username: user.name
				status: onlineUsers[username]?.status
				muted: username in roomMuted
				utcOffset: utcOffset
			}

		users = _.sortBy users, 'username'
		# show online users first.
		# sortBy is stable, so we can do this
		users = _.sortBy users, (u) -> !u.status?

		usersLimit = Template.instance().usersLimit.get()
		hasMore = users.length > usersLimit
		users = _.first(users, usersLimit)

		totalUsers = roomUsernames.length
		totalShowing = users.length
		totalOnline = roomOnlineUsernames.length

		ret =
			_id: this.rid<commit_msg>caring for rc user<commit_after>Template.membersList.helpers
	tAddUsers: ->
		return t('Add_users')

	isGroupChat: ->
		return ChatRoom.findOne(this.rid, { reactive: false })?.t in ['c', 'p']

	isDirectChat: ->
		return ChatRoom.findOne(this.rid, { reactive: false })?.t is 'd'

	seeAll: ->
		if Template.instance().showAllUsers.get()
			return t('Show_only_online')
		else
			return t('Show_all')

	roomUsers: ->
		onlineUsers = RoomManager.onlineUsers.get()
		room = ChatRoom.findOne(this.rid)
		roomUsernames = room?.usernames or []
		roomOnlineUsernames = roomUsernames.filter((username) -> onlineUsers[username])
		roomMuted = room?.muted or []

		if Template.instance().showAllUsers.get()
			usernames = roomUsernames
		else
			usernames = roomOnlineUsernames

		users = usernames.map (username) ->
			utcOffset = onlineUsers[username]?.utcOffset

			if utcOffset?
				if utcOffset > 0
					utcOffset = "+#{utcOffset}"
				utcOffset = "(UTC #{utcOffset})"
			user = Meteor.users.findOne({username:username})
			if (user)
				realname = user.name
			else
				realname = username

			return {
				username: realname
				status: onlineUsers[username]?.status
				muted: username in roomMuted
				utcOffset: utcOffset
			}

		users = _.sortBy users, 'username'
		# show online users first.
		# sortBy is stable, so we can do this
		users = _.sortBy users, (u) -> !u.status?

		usersLimit = Template.instance().usersLimit.get()
		hasMore = users.length > usersLimit
		users = _.first(users, usersLimit)

		totalUsers = roomUsernames.length
		totalShowing = users.length
		totalOnline = roomOnlineUsernames.length

		ret =
			_id: this.rid
{'fraction_non_alphanumeric': 0.12484394506866417, 'fraction_numerical': 0.0006242197253433209, 'mean_word_length': 3.720176730486009, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4440693', 'n_tokens_mistral': 1227, 'n_tokens_neox': 1068, 'n_words': 241}