"use strict";

module.exports = function mapPresenceEvent(event, _context) {
	return {
		type: "userChangedStatus",
		user: event.sender,
		displayName: event.content.displayname,
		avatar: event.content.avatar_url,
		status: event.content.presence,
		statusMessage: event.content.status_msg,
		isActive: event.content.currently_active,
		lastActive: (event.content.last_active_ago != null)
			? Date.now() - (event.content.last_active_ago * 1000)
			: undefined,
	};
};
