From 9bd23acb3dd14e381b7c97041a2a70712890761d Mon Sep 17 00:00:00 2001 From: Mark Holmquist Date: Tue, 17 Jul 2012 10:12:10 -0700 Subject: [PATCH] Add userJoinOrUpdate hook This hook fires on the client side, whenever a user joins or updates (hence the name). It will pass one thing, the user's info, into the context. This is mostly just for notification purposes. --- src/static/js/pad_userlist.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/static/js/pad_userlist.js b/src/static/js/pad_userlist.js index d8382585..474f9b0e 100644 --- a/src/static/js/pad_userlist.js +++ b/src/static/js/pad_userlist.js @@ -21,6 +21,7 @@ */ var padutils = require('./pad_utils').padutils; +var hooks = require('./pluginfw/hooks'); var myUserInfo = {}; @@ -529,6 +530,10 @@ var paduserlist = (function() return; } + hooks.callAll('userJoinOrUpdate', { + userInfo: info + }); + var userData = {}; userData.color = typeof info.colorId == "number" ? clientVars.colorPalette[info.colorId] : info.colorId; userData.name = info.name;