Skip to content

Commit

Permalink
Merge pull request #94 from skaughtx0r/master
Browse files Browse the repository at this point in the history
Option to only log publish messages to history
  • Loading branch information
bubbleboy14 committed Jan 9, 2012
2 parents 8404209 + 4865dee commit c008763
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hookbox/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class Channel(object):
'reflective': True,
'history': [],
'history_size': 0,
'history_publish_only': False,
'moderated': True,
'moderated_publish': False,
'moderated_subscribe': False,
Expand Down Expand Up @@ -227,7 +228,7 @@ def subscribe(self, user, conn=None, needs_auth=True):

user.send_frame('SUBSCRIBE', frame)

if self.history_size:
if self.history_size and not self.history_publish_only:
self.history.append(('SUBSCRIBE', {"user": user.get_name(), "datetime": _now }))
self.prune_history()

Expand Down Expand Up @@ -319,7 +320,7 @@ def unsubscribe(self, user, conn=None, needs_auth=True, force_auth=False):
user.send_frame('UNSUBSCRIBE', frame)
self.subscribers.remove(user)
user.channel_unsubscribed(self)
if self.history_size:
if self.history_size and not self.history_publish_only:
del frame['channel_name']
self.history.append(('UNSUBSCRIBE', frame))
self.prune_history()
Expand Down

0 comments on commit c008763

Please sign in to comment.