Skip to content

Commit

Permalink
Merge pull request #178 from ridersshare/patch-2
Browse files Browse the repository at this point in the history
Added optional startupQuerySelector
  • Loading branch information
StorytellerCZ authored Jan 19, 2024
2 parents cf733ad + 81a37ef commit 562aaab
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions server/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const UserConnections = new Mongo.Collection('user_status_sessions', {
connection: null
});

const statusEvents = new(EventEmitter)();
const statusEvents = new (EventEmitter)();

/*
Multiplex login/logout events to status.online
Expand Down Expand Up @@ -135,7 +135,7 @@ statusEvents.on('connectionActive', (advice) => {
// Reset online status on startup (users will reconnect)
const onStartup = (selector) => {
if (selector == null) {
selector = {};
selector = Meteor?.settings?.packages?.['mizzao:user-status']?.startupQuerySelector || {};
}
return Meteor.users.update(selector, {
$set: {
Expand Down Expand Up @@ -184,11 +184,11 @@ const loginSession = (connection, date, userId) => {
const tryLogoutSession = (connection, date) => {
let conn;
if ((conn = UserConnections.findOne({
_id: connection.id,
userId: {
$exists: true
}
})) == null) {
_id: connection.id,
userId: {
$exists: true
}
})) == null) {
return false;
}

Expand Down

0 comments on commit 562aaab

Please sign in to comment.