def mark_online(user_id, guest=False):
 now = int(time.time())
 expires = ((now + (flaskbb_config['ONLINE_LAST_MINUTES'] * 60)) + 10)
 if guest:
  all_users_key = ('online-guests/%d' % (now // 60))
  user_key = ('guest-activity/%s' % user_id)
 else:
  all_users_key = ('online-users/%d' % (now // 60))
  user_key = ('user-activity/%s' % user_id)
 p = redis_store.pipeline()
 p.sadd(all_users_key, user_id)
 p.set(user_key, now)
 p.expireat(all_users_key, expires)
 p.expireat(user_key, expires)
 p.execute()

def mark_online ( user_id , guest = False ) : now = int ( time . time ( ) ) expires = ( ( now + ( flaskbb_config [ 'ONLINE_LAST_MINUTES' ] * 60 ) ) + 10 ) if guest : all_users_key = ( 'online-guests/%d' % ( now // 60 ) ) user_key = ( 'guest-activity/%s' % user_id ) else : all_users_key = ( 'online-users/%d' % ( now // 60 ) ) user_key = ( 'user-activity/%s' % user_id ) p = redis_store . pipeline ( ) p . sadd ( all_users_key , user_id ) p . set ( user_key , now ) p . expireat ( all_users_key , expires ) p . expireat ( user_key , expires ) p . execute ( )
marks a user as online .