#NEWLINE# def inbox_store( self , users , msg_instance ) : #NEWLINE# #INDENT# if ( not self . can_handle ( msg_instance ) ) : #NEWLINE# #INDENT# raise MessageTypeNotSupported ( ) #NEWLINE# #UNINDENT# for user in users : #NEWLINE# #INDENT# if self . client . sismember ( ( 'user:%d:notificationsidx' % self . pk ) , msg_instance . id ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . client . sadd ( ( 'user:%d:notificationsidx' % user . pk ) , msg_instance . id ) #NEWLINE# #UNINDENT# self . client . rpush ( ( 'user:%d:notifications' % user . pk ) , self . _toJSON ( msg_instance ) ) #NEWLINE# signals . inbox_stored . send ( sender = self . __class__ , user = user , message = msg_instance )