Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug which prevents writing thread replies in some cases #78

Merged
merged 2 commits into from
Jan 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lemmy_bb"
version = "0.1.3"
version = "0.1.4"
edition = "2021"

[profile.release]
Expand All @@ -18,8 +18,8 @@ embed-lemmy = ["lemmy_server", "send_wrapper"]
[dependencies]
log = "0.4.17"
env_logger = { version = "0.9.1", features = ["termcolor", "humantime", "atty"], default-features = false }
lemmy_api_common = { git = "https://github.com/LemmyNet/lemmy.git" }
lemmy_server = { git = "https://github.com/LemmyNet/lemmy.git", optional = true }
lemmy_api_common = { git = "https://github.com/LemmyNet/lemmy.git", tag = "0.17.0-rc.1" }
lemmy_server = { git = "https://github.com/LemmyNet/lemmy.git", tag = "0.17.0-rc.1", optional = true }
once_cell = "1.15.0"
anyhow = "1.0.66"
rocket = { version = "0.5.0-rc.2", default-features = false }
Expand All @@ -41,5 +41,5 @@ send_wrapper = { version = "0.6.0", features = ["futures"], optional = true }
[dev-dependencies]
serial_test = "0.9.0"
ctor = "0.1.26"
lemmy_server = { git = "https://github.com/LemmyNet/lemmy.git" }
lemmy_server = { git = "https://github.com/LemmyNet/lemmy.git", tag = "0.17.0-rc.1" }
actix-rt = "2.7.0"
5 changes: 3 additions & 2 deletions src/api/site.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use crate::api::{get, post};
use anyhow::Error;
use futures::future::join;
use lemmy_api_common::{
lemmy_db_schema::source::local_site::RegistrationMode,
sensitive::Sensitive,
site::{
CreateSite,
Expand All @@ -16,13 +17,13 @@ use lemmy_api_common::{
pub async fn create_site(
name: String,
description: Option<String>,
require_application: bool,
registration_mode: RegistrationMode,
auth: Sensitive<String>,
) -> Result<SiteResponse, Error> {
let params = CreateSite {
name,
description,
require_application: Some(require_application),
registration_mode: Some(registration_mode),
auth,
..Default::default()
};
Expand Down
4 changes: 2 additions & 2 deletions src/routes/site.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use crate::{
use anyhow::Error;
use futures::future::join_all;
use lemmy_api_common::{
lemmy_db_schema::ListingType,
lemmy_db_schema::{source::local_site::RegistrationMode, ListingType},
lemmy_db_views_actor::structs::CommunityView,
};
use rocket::{form::Form, http::CookieJar, response::Redirect, Either};
Expand Down Expand Up @@ -116,7 +116,7 @@ pub async fn do_setup(
create_site(
form.site_name.clone(),
form.site_description.clone(),
true,
RegistrationMode::RequireApplication,
jwt,
)
.await?;
Expand Down
8 changes: 6 additions & 2 deletions src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ use crate::{
routes::{community::*, post::*, site::*, user::*},
site_fairing::test_site_data,
};
use lemmy_api_common::{sensitive::Sensitive, site::GetSiteResponse};
use lemmy_api_common::{
lemmy_db_schema::source::local_site::RegistrationMode,
sensitive::Sensitive,
site::GetSiteResponse,
};
use log::LevelFilter;
use rand::{distributions::Alphanumeric, Rng};
use reqwest::StatusCode;
Expand Down Expand Up @@ -88,7 +92,7 @@ async fn init_backend() -> Sensitive<String> {
create_site(
"test".to_string(),
Some("test".to_string()),
false,
RegistrationMode::Open,
auth.clone(),
)
.await
Expand Down
2 changes: 1 addition & 1 deletion templates/comment_editor.html.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<div id="topicreview" class="topicreview">
{{#each page_comments}}
{{> components/comment site_data=../site_data hide_author=true }}
{{> components/comment site_data=../site_data hide_author=true all_comments=../all_comments }}
{{/each}}
{{log (len page_comments)}}
{{#unless eq (len page_comments) 20}}
Expand Down
2 changes: 1 addition & 1 deletion templates/components/comment.html.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<a href="{{this.comment.ap_id}}"><img src="/assets/images/icons/fedilink.svg" width="16px" height="16px"></a>
{{#if this.comment.parent_id}}
<span style="float: right; margin-right: 100px">
{{{i18n ../site_data "responding_to"}}} <a href="/view_topic?t={{this.post.id}}&page={{comment_page this.comment.parent_id ../all_comments}}#p{{this.comment.parent_id}}">#{{this.comment.parent_id}}</a>
{{{i18n ../site_data "responding_to"}}} <a href="/view_topic?t={{this.post.id}}&page={{comment_page this.comment.parent_id all_comments}}#p{{this.comment.parent_id}}">#{{this.comment.parent_id}}</a>
</span>
{{/if}}
</p>
Expand Down
1 change: 1 addition & 0 deletions templates/view_topic.html.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

{{#each page_comments}}
{{> components/comment }}
{{> components/comment site_data=../site_data all_comments=../all_comments }}
{{/each}}

<div class="action-bar bar-bottom">
Expand Down