<commit_before>fields =
	t: 1
	ts: 1
	ls: 1
	name: 1
	rid: 1
	code: 1
	f: 1
	u: 1
	open: 1
	alert: 1
	roles: 1
	unread: 1
	archived: 1
	desktopNotifications: 1
	mobilePushNotifications: 1
	emailNotifications: 1


Meteor.methods
	subscriptions: ->
		unless Meteor.userId()
			return []

		this.unblock()

		options =
			fields: fields

		return RocketChat.models.Subscriptions.findByUserId(Meteor.userId(), options).fetch()


RocketChat.models.Subscriptions.on 'change', (type, args...) ->
	if type is 'update' and args[0]?.alert?.$ne?
		delete args[0].alert

	records = RocketChat.models.Subscriptions.getChangedRecords type, args[0], fields

	for record in records
		RocketChat.Notifications.notifyUser record.u._id, 'subscription-change', type, record<commit_msg>Remove unecessary code<commit_after>fields =
	t: 1
	ts: 1
	ls: 1
	name: 1
	rid: 1
	code: 1
	f: 1
	u: 1
	open: 1
	alert: 1
	roles: 1
	unread: 1
	archived: 1
	desktopNotifications: 1
	mobilePushNotifications: 1
	emailNotifications: 1


Meteor.methods
	subscriptions: ->
		unless Meteor.userId()
			return []

		this.unblock()

		options =
			fields: fields

		return RocketChat.models.Subscriptions.findByUserId(Meteor.userId(), options).fetch()


RocketChat.models.Subscriptions.on 'change', (type, args...) ->
	records = RocketChat.models.Subscriptions.getChangedRecords type, args[0], fields

	for record in records
		RocketChat.Notifications.notifyUser record.u._id, 'subscription-change', type, record
{'fraction_non_alphanumeric': 0.11504424778761062, 'fraction_numerical': 0.02450646698434309, 'mean_word_length': 4.104166666666667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '7473140', 'n_tokens_mistral': 586, 'n_tokens_neox': 519, 'n_words': 135}