#NEWLINE# def salmon_reply( handler , user_remote , content , thread = None , mentioned_users = [ ] ) : #NEWLINE# #INDENT# user = salmon_common ( handler ) #NEWLINE# handler . display [ 'id' ] = handler . content_url ( content ) #NEWLINE# handler . display [ 'title' ] = content . title #NEWLINE# handler . display [ 'atom_content' ] = content . view #NEWLINE# handler . display [ 'date_created' ] = content . date_created #NEWLINE# handler . display [ 'date_updated' ] = content . date_updated #NEWLINE# object_type = ( 'comment' if ( content . section == 'comments' ) else 'note' ) #NEWLINE# handler . display [ 'verb' ] = 'http://activitystrea.ms/schema/1.0/post' #NEWLINE# handler . display [ 'activity_extra' ] = ( '\n    <activity:object-type>\n      http://activitystrea.ms/schema/1.0/%(object_type)s\n    </activity:object-type>\n    <link href="%(content_url)s" rel="alternate" type="text/html" />' % { #NEWLINE# #INDENT# 'object_type' : object_type , #NEWLINE# 'content_url' : handler . content_url ( content , host = True ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# for mentioned_user in mentioned_users : #NEWLINE# #INDENT# handler . display [ 'activity_extra' ] += ( '\n    <link href="%(profile_url)s" rel="ostatus:attention" />\n    <link href="%(profile_url)s" rel="mentioned" />\n  ' % { #NEWLINE# #INDENT# 'profile_url' : mentioned_user . profile_url , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# thread = ( thread or content . thread ) #NEWLINE# if thread : #NEWLINE# #INDENT# handler . display [ 'activity_extra' ] += ( '\n        <thr:in-reply-to ref="%(thread)s" />' % { #NEWLINE# #INDENT# 'thread' : thread , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# if content . comments_count : #NEWLINE# #INDENT# handler . display [ 'activity_extra' ] += ( '\n        <thr:replies type="application/atom+xml" href="%(url)s"\n        count="%(count)s" updated="%(updated)s" />' % { #NEWLINE# #INDENT# 'url' : handler . nav_url ( host = True , username = content . username , section = 'feed' , comments = handler . content_url ( content ) ) , #NEWLINE# 'count' : content . comments_count , #NEWLINE# 'updated' : content . comments_updated . strftime ( '%Y-%m-%dT%H:%M:%S+00:00' ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# atom_html = handler . render_string ( 'feed.html' , ** handler . display ) #NEWLINE# salmon_send ( handler , user , user_remote . salmon_url , atom_html )