Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Notify admins when a new user signs up.

  • Loading branch information...
commit add87dbc1343b9121136809a9ca2d76d0ac2816b 1 parent 4ce3662
@dustin authored
Showing with 7 additions and 1 deletion.
  1. +3 −1 lib/wu_config.py
  2. +2 −0  lib/wu_protocol.py
  3. +2 −0  whatsup.conf.sample
View
4 lib/wu_config.py
@@ -14,4 +14,6 @@
VERSION=commands.getoutput("git describe").strip()
BATCH_CONCURRENCY=CONF.getint('general', 'batch_concurrency')
-WATCH_FREQ=CONF.getint('general', 'watch_freq')
+WATCH_FREQ=CONF.getint('general', 'watch_freq')
+
+ADMINS=CONF.get("general", "admins").split(' ')
View
2  lib/wu_protocol.py
@@ -115,6 +115,8 @@ def subscribedReceived(self, entity):
But I can do more. Type "help" for more info.
"""
self.send_plain(entity.full(), welcome_message)
+ for a in wu_config.ADMINS:
+ self.send_plain(a, "New subscriber: " + entity.userhost())
def unsubscribedReceived(self, entity):
print "Unsubscribed received from %s" % (entity.userhost())
View
2  whatsup.conf.sample
@@ -3,6 +3,8 @@ loop_sleep: 60
db: sqlite:///whatsup.sqlite3
batch_concurrency: 2
watch_freq: 15
+# Space separated list of admins
+admins: dustin@sallings.org
[xmpp]
jid: mybot@jabber.org/whatsupbot
Please sign in to comment.
Something went wrong with that request. Please try again.