 	selectable: ->
 		return Template.instance().selectable.get()
 
+isSocialSharingOpen = false
+
 Template.room.events
 	"click, touchend": (e, t) ->
 		Meteor.setTimeout ->

		, 100

	"touchstart .message": (e, t) ->
		if e.originalEvent.touches.length isnt 1
			return

		if e.target and e.target.nodeName is 'A'
			return

		if $(e.currentTarget).hasClass('system')
			return

		message = this._arguments[1]
		doLongTouch = =>
			mobileMessageMenu.show(message, t, e, this)

		Meteor.clearTimeout t.touchtime
		t.touchtime = Meteor.setTimeout doLongTouch, 500

	"touchend .message": (e, t) ->
		Meteor.clearTimeout t.touchtime

	"touchmove .message": (e, t) ->
		Meteor.clearTimeout t.touchtime

socialSharing = (options = {}) ->
	window.plugins.socialsharing.share(options.message, options.subject, options.file, options.link)

isSubscribed = (_id) ->
	return ChatSubscription.find({ rid: _id }).count() > 0

