#NEWLINE# def assemble_inbox_data( request , entries , actor_streams , inbox_owner_ref ) : #NEWLINE# #INDENT# stream_keys = [ e . stream for e in entries ] #NEWLINE# stream_keys += [ s . key ( ) . name ( ) for s in actor_streams ] #NEWLINE# streams = api . stream_get_streams ( request . user , stream_keys ) #NEWLINE# contact_nicks = api . actor_get_contacts_safe ( request . user , inbox_owner_ref . nick , limit = CONTACTS_PER_PAGE ) #NEWLINE# channels = api . actor_get_channels_member_safe ( request . user , inbox_owner_ref . nick , limit = CHANNELS_PER_PAGE ) #NEWLINE# actor_nicks = ( ( ( ( contact_nicks + [ inbox_owner_ref . nick ] ) + [ s . owner for s in streams . values ( ) ] ) + [ e . owner for e in entries ] ) + [ e . actor for e in entries ] ) #NEWLINE# actors = api . actor_get_actors ( request . user , actor_nicks ) #NEWLINE# contacts = [ actors [ x ] for x in contact_nicks if actors [ x ] ] #NEWLINE# streams = display . prep_stream_dict ( streams , actors ) #NEWLINE# entries = display . prep_entry_list ( entries , streams , actors ) #NEWLINE# return ( contacts , channels , streams , entries )