#NEWLINE# def share( request ) : #NEWLINE# #INDENT# "Publish a message to the users feed or a room (if 'room' is set in the\n    POST dict.\n\n    Authentication is required.\n    " #NEWLINE# if ( not request . session . get ( 'nickname' , None ) ) : #NEWLINE# #INDENT# return HttpResponseRedirect ( reverse ( 'login' ) ) #NEWLINE# #UNINDENT# f = friendfeed . FriendFeed ( request . session [ 'nickname' ] , request . session [ 'key' ] ) #NEWLINE# if ( request . method == 'POST' ) : #NEWLINE# #INDENT# if ( 'title' in request . POST ) : #NEWLINE# #INDENT# data = f . publish_message ( request . POST [ 'title' ] , via = VIA , room = request . POST . get ( 'room' , None ) ) #NEWLINE# if ( 'errorCode' in data ) : #NEWLINE# #INDENT# return error ( request , data ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# next = reverse ( 'entry' , args = [ data [ 'entries' ] [ 0 ] [ 'id' ] ] ) #NEWLINE# args = { #NEWLINE# #INDENT# 'message' : 'shared' , #NEWLINE# 'entry' : data [ 'entries' ] [ 0 ] [ 'id' ] , #NEWLINE# #UNINDENT# } #NEWLINE# next += ( '?%s#%s' % ( urllib . urlencode ( args ) , data [ 'entries' ] [ 0 ] [ 'id' ] ) ) #NEWLINE# return HttpResponseRedirect ( next )