From e45c8d9db3a590749b1bcbaa90c463a465942453 Mon Sep 17 00:00:00 2001 From: freamon Date: Sun, 19 Jan 2025 15:04:32 +0000 Subject: [PATCH] Also use search.retrieve_remote_post() for requests from community side bar --- app/community/routes.py | 21 +-------------------- app/templates/_side_pane.html | 2 +- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/app/community/routes.py b/app/community/routes.py index 319a469a..f0b12b21 100644 --- a/app/community/routes.py +++ b/app/community/routes.py @@ -21,8 +21,7 @@ from app.chat.util import send_message from app.community.forms import SearchRemoteCommunity, CreateDiscussionForm, CreateImageForm, CreateLinkForm, \ ReportCommunityForm, \ DeleteCommunityForm, AddCommunityForm, EditCommunityForm, AddModeratorForm, BanUserCommunityForm, \ - EscalateReportForm, ResolveReportForm, CreateVideoForm, CreatePollForm, RetrieveRemotePost, \ - EditCommunityWikiPageForm + EscalateReportForm, ResolveReportForm, CreateVideoForm, CreatePollForm, EditCommunityWikiPageForm from app.community.util import search_for_community, actor_to_community, \ save_icon_file, save_banner_file, send_to_remote_instance, \ delete_post_from_community, delete_post_reply_from_community, community_in_list, find_local_users, tags_from_string, \ @@ -152,24 +151,6 @@ def add_remote(): site=g.site) -@bp.route('/retrieve_remote_post/', methods=['GET', 'POST']) -@login_required -def retrieve_remote_post(community_id: int): - if current_user.banned: - return show_ban_message() - form = RetrieveRemotePost() - new_post = None - community = Community.query.get_or_404(community_id) - if form.validate_on_submit(): - address = form.address.data.strip() - new_post = resolve_remote_post(address, community_id) - if new_post is None: - flash(_('Post not found.'), 'warning') - - return render_template('community/retrieve_remote_post.html', - title=_('Retrieve Remote Post'), form=form, new_post=new_post, community=community) - - # @bp.route('/c/', methods=['GET']) - defined in activitypub/routes.py, which calls this function for user requests. A bit weird. def show_community(community: Community): diff --git a/app/templates/_side_pane.html b/app/templates/_side_pane.html index d067159a..face4b8a 100644 --- a/app/templates/_side_pane.html +++ b/app/templates/_side_pane.html @@ -52,7 +52,7 @@ {% if rss_feed and not community.is_local() -%} {% endif -%} {% if community.local_only -%}