 			# create recipient roster item if necessary
 			sails.services.roster
 				.findOrCreate values.to, values.from
-				.then (roster) ->
-					roster.newmsg = roster.newmsg + 1
-					roster.save().catch sails.log.error
+				.then (item) ->
+					item.lastmsgAt = values.createdAt
+					item.newmsg = item.newmsg + 1
+					item.save().catch sails.log.error
 					sails.services.rest()
 						.push req.user.token, item, values
 						.catch sails.log.error
					_.each roster, (item) ->
						item.lastmsgAt = values.createdAt
						if item.createdBy.jid != values.from
							newmsg(item)
							sails.services.rest()
								.push req.user.token, item, values
								.catch sails.log.error

		
	afterPublishCreate: (values, req) ->
		# update all target recipients corresponding roster items, and send push notification
		
		if sails.services.jid.isMuc(values.to)
			# update all subscribed parties (jid exists in roster)
