Coder Social home page Coder Social logo

sethunath / meteor-user-presence Goto Github PK

View Code? Open in Web Editor NEW

This project forked from konecty/meteor-user-presence

0.0 2.0 0.0 69 KB

Monitor the user's connection and prefered states

Home Page: http://user-presence-example.meteor.com/

License: MIT License

JavaScript 100.00%

meteor-user-presence's Introduction

USER PRESENCE

This package monitors the user to track user's state and save 3 fields in user's record:

  • statusDefault - Status setted by user
  • statusConnection - Connection status (offline, online and away)
  • status
    • Offline if statusConnection or statusDefault are offline
    • Seme as statusConnection if statusDefault is online
    • Same as statusDefault

How to use

Add package

meteor add konecty:user-presence

Configure client

//CLIENT
Meteor.startup(function() {
	// Time of inactivity to set user as away automaticly. Default 60000
	UserPresence.awayTime = 300000;
	// Set user as away when window loses focus. Defaults false
	UserPresence.awayOnWindowBlur = true;
	// Start monitor for user activity
	UserPresence.start();
});

Start server

//SERVER
// Listen for new connections, login, logoff and application exit to manage user status and register methods to be used by client to set user status and default status
UserPresence.start();
// Active logs for every changes
// Listen for changes in UserSessions and Meteor.users to set user status based on active connections
UserPresenceMonitor.start();

Logs

//SERVER
UserPresence.activeLogs();

Server Methods

// Create a new connection, this package do this automaticly
Meteor.call('UserPresence:connect');
// Set connection as away, can be usefull call this method if you are using cordova to ser user as away when application goes to background for example.
Meteor.call('UserPresence:away');
// Set connection as online
Meteor.call('UserPresence:online');
// Changes the default status of user
Meteor.call('UserPresence:setDefaultStatus', 'busy');

meteor-user-presence's People

Contributors

elie222 avatar kirbyssmith avatar paulincai avatar rodrigok avatar sampaiodiego avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.