def topic_is_unread(topic, topicsread, user, forumsread=None):
 if (not user.is_authenticated):
  return False
 read_cutoff = (time_utcnow() - timedelta(days=flaskbb_config['TRACKER_LENGTH']))
 if (flaskbb_config['TRACKER_LENGTH'] == 0):
  return False
 if (topic.last_post.date_created < read_cutoff):
  return False
 if (topicsread is None):
  if (forumsread and (forumsread.cleared is not None)):
   return (forumsread.cleared < topic.last_post.date_created)
  return True
 return (topicsread.last_read < topic.last_post.date_created)

def topic_is_unread ( topic , topicsread , user , forumsread = None ) : if ( not user . is_authenticated ) : return False read_cutoff = ( time_utcnow ( ) - timedelta ( days = flaskbb_config [ 'TRACKER_LENGTH' ] ) ) if ( flaskbb_config [ 'TRACKER_LENGTH' ] == 0 ) : return False if ( topic . last_post . date_created < read_cutoff ) : return False if ( topicsread is None ) : if ( forumsread and ( forumsread . cleared is not None ) ) : return ( forumsread . cleared < topic . last_post . date_created ) return True return ( topicsread . last_read < topic . last_post . date_created )
checks if a topic is unread .