Skip to content

Commit

Permalink
Merge tag 'v1.124.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
link2xt committed Oct 5, 2023
2 parents 2757915 + 47dbac9 commit a119b24
Show file tree
Hide file tree
Showing 14 changed files with 65 additions and 14 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## [1.124.1] - 2023-10-05

### Fixes

- Remove footer from reactions on the receiver side ([#4780](https://github.com/deltachat/deltachat-core-rust/pull/4780)).

### CI

- Pin `urllib3` version to `<2`. ([#4788](https://github.com/deltachat/deltachat-core-rust/issues/4788))

## [1.124.0] - 2023-10-04

### API-Changes
Expand Down Expand Up @@ -2868,3 +2878,4 @@ https://github.com/deltachat/deltachat-core-rust/pulls?q=is%3Apr+is%3Aclosed
[1.122.0]: https://github.com/deltachat/deltachat-core-rust/compare/v1.121.0...v1.122.0
[1.123.0]: https://github.com/deltachat/deltachat-core-rust/compare/v1.122.0...v1.123.0
[1.124.0]: https://github.com/deltachat/deltachat-core-rust/compare/v1.123.0...v1.124.0
[1.124.1]: https://github.com/deltachat/deltachat-core-rust/compare/v1.124.0...v1.124.1
10 changes: 5 additions & 5 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "deltachat"
version = "1.124.0"
version = "1.124.1"
edition = "2021"
license = "MPL-2.0"
rust-version = "1.67"
Expand Down
2 changes: 1 addition & 1 deletion deltachat-ffi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "deltachat_ffi"
version = "1.124.0"
version = "1.124.1"
description = "Deltachat FFI"
edition = "2018"
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion deltachat-jsonrpc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "deltachat-jsonrpc"
version = "1.124.0"
version = "1.124.1"
description = "DeltaChat JSON-RPC API"
edition = "2021"
default-run = "deltachat-jsonrpc-server"
Expand Down
2 changes: 1 addition & 1 deletion deltachat-jsonrpc/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@
},
"type": "module",
"types": "dist/deltachat.d.ts",
"version": "1.124.0"
"version": "1.124.1"
}
2 changes: 1 addition & 1 deletion deltachat-repl/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "deltachat-repl"
version = "1.124.0"
version = "1.124.1"
license = "MPL-2.0"
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion deltachat-rpc-server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "deltachat-rpc-server"
version = "1.124.0"
version = "1.124.1"
description = "DeltaChat JSON-RPC server"
edition = "2021"
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@
"test:mocha": "mocha -r esm node/test/test.js --growl --reporter=spec --bail --exit"
},
"types": "node/dist/index.d.ts",
"version": "1.124.0"
"version": "1.124.1"
}
3 changes: 3 additions & 0 deletions python/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ deps =
pytest-xdist
pdbpp
requests
# urllib3 2.0 does not work in manylinux2014 containers.
# https://github.com/deltachat/deltachat-core-rust/issues/4788
urllib3<2

[testenv:.pkg]
passenv =
Expand Down
2 changes: 1 addition & 1 deletion release-date.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023-10-04
2023-10-05
26 changes: 26 additions & 0 deletions src/reaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,32 @@ Content-Disposition: reaction\n\
assert_eq!(bob_reaction.emojis(), vec!["👍"]);
assert_eq!(bob_reaction.as_str(), "👍");

// Alice receives reaction to her message from Bob with a footer.
receive_imf(
&alice,
"To: alice@example.org\n\
From: bob@example.net\n\
Date: Today, 29 February 2021 00:00:10 -800\n\
Message-ID: 56790@example.net\n\
In-Reply-To: 12345@example.org\n\
Subject: Meeting\n\
Mime-Version: 1.0 (1.0)\n\
Content-Type: text/plain; charset=utf-8\n\
Content-Disposition: reaction\n\
\n\
😀\n\
\n\
--\n\
_______________________________________________\n\
Here's my footer -- bob@example.net"
.as_bytes(),
false,
)
.await?;

let reactions = get_msg_reactions(&alice, msg.id).await?;
assert_eq!(reactions.to_string(), "😀1");

Ok(())
}

Expand Down
4 changes: 3 additions & 1 deletion src/receive_imf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ use crate::param::{Param, Params};
use crate::peerstate::{Peerstate, PeerstateKeyType, PeerstateVerifiedStatus};
use crate::reaction::{set_msg_reaction, Reaction};
use crate::securejoin::{self, handle_securejoin_handshake, observe_securejoin_on_other_device};
use crate::simplify;
use crate::sql;
use crate::stock_str;
use crate::tools::{
Expand Down Expand Up @@ -1119,12 +1120,13 @@ async fn add_parts(

for part in &mut mime_parser.parts {
if part.is_reaction {
let reaction_str = simplify::remove_footers(part.msg.as_str());
set_msg_reaction(
context,
&mime_in_reply_to,
orig_chat_id.unwrap_or_default(),
from_id,
Reaction::from(part.msg.as_str()),
Reaction::from(reaction_str.as_str()),
)
.await?;
}
Expand Down
9 changes: 9 additions & 0 deletions src/simplify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ fn remove_nonstandard_footer<'a>(lines: &'a [&str]) -> (&'a [&'a str], bool) {
(lines, false)
}

/// Remove footers if any.
/// This also makes all newlines "\n", but why not.
pub(crate) fn remove_footers(msg: &str) -> String {
let lines = split_lines(msg);
let lines = remove_message_footer(&lines).0;
let lines = remove_nonstandard_footer(lines).0;
lines.join("\n")
}

pub(crate) fn split_lines(buf: &str) -> Vec<&str> {
buf.split('\n').collect()
}
Expand Down

0 comments on commit a119b24

Please sign in to comment.