Merge pull request 'update' (#306) from update-flake into main

Reviewed-on: #306
This commit is contained in:
Charlotte 🦝 Delenk 2023-08-09 09:43:47 +00:00
commit 6a3b199033
Signed by: gitea-bot
GPG key ID: C9974EDF9932B558
6 changed files with 33 additions and 49 deletions

View file

@ -1,10 +1,10 @@
{
"url": "https://akkoma.dev/AkkomaGang/akkoma.git",
"rev": "59af68c60014e87cbd46c5aa798065adfeb6c8f0",
"date": "2023-08-05T14:11:27+01:00",
"path": "/nix/store/idk900v8jhrdimpinc9filn5xamps3hs-akkoma",
"sha256": "05fir3whsjksgcg5dmz99riic877fwm274g71hw99bzypab9a7aj",
"hash": "sha256-Uh2Vlrr+r5Q4DOeRIyp35yAWY07p11Yee3pKDfnI0RU=",
"rev": "e7788f3c827c9d13a680eef98b3127294dd9f614",
"date": "2023-08-08T22:42:57+01:00",
"path": "/nix/store/60n3dqka0dj37k6iinz64dk4ln9hb39f-akkoma",
"sha256": "1dbn12c2h3rs1k3s978b5sj3izamm30vbrxbvjk91gw857ydj949",
"hash": "sha256-iSTZ/CmIv5Cm3KvntcGoVf04pC4LnaTHDDoPKJgIdrU=",
"fetchLFS": false,
"fetchSubmodules": false,
"deepClone": false,

View file

@ -259,11 +259,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1691309005,
"narHash": "sha256-am/1S8c+Uirq1OcZ+N9auuHvTL6cyeZsbZqTuVdFHzU=",
"lastModified": 1691568519,
"narHash": "sha256-8C0f+Z3QOKb5zcvDdfys/aHU85kAwsGpYlB9Dc5/4P8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4d0cb68e29ae0137c3d659edaa6baacf9a79f9ae",
"rev": "73a383e05ad819ef777d9a79ea8cdb3c38ceba28",
"type": "github"
},
"original": {

View file

@ -4,25 +4,11 @@
fetchFromGitHub,
}: let
source = builtins.fromJSON (builtins.readFile ./source.json);
python = python3.override {
packageOverrides = self: super: {
dask = super.dask.overridePythonAttrs (_: {
installCheckPhase = "true";
});
pyarrow = super.pyarrow.overridePythonAttrs (old: {
installCheckPhase = "true";
});
tifffile = super.tifffile.overridePythonAttrs (old: {
installCheckPhase = "true";
});
};
};
in
python.pkgs.buildPythonPackage rec {
python3.pkgs.buildPythonPackage rec {
pname = "mautrix-telegram";
version = source.date;
disabled = python.pythonOlder "3.8";
disabled = python3.pythonOlder "3.8";
src = fetchFromGitHub {
owner = "mautrix";
@ -37,14 +23,14 @@ in
--replace "asyncpg>=0.20,<0.27" "asyncpg>=0.20"
'';
propagatedBuildInputs = with python.pkgs; [
propagatedBuildInputs = with python3.pkgs; [
ruamel-yaml
python-magic
CommonMark
aiohttp
yarl
(python.pkgs.callPackage ../../python/mautrix.nix {})
(python.pkgs.callPackage ../../python/tulir-telethon.nix {})
(python3.pkgs.callPackage ../../python/mautrix.nix {})
(python3.pkgs.callPackage ../../python/tulir-telethon.nix {})
asyncpg
Mako
# optional
@ -72,7 +58,7 @@ in
description = "A Matrix-Telegram hybrid puppeting/relaybot bridge";
license = licenses.agpl3Plus;
platforms = platforms.linux;
broken = !(python.pkgs ? cryptg);
broken = !(python3.pkgs ? cryptg);
};
passthru.updateScript = [
../../scripts/update-git.sh

View file

@ -1,8 +1,8 @@
diff --git a/mautrix_telegram/portal.py b/mautrix_telegram/portal.py
index 3b6a81e..c6277a7 100644
index 701b3eb..8a266bc 100644
--- a/mautrix_telegram/portal.py
+++ b/mautrix_telegram/portal.py
@@ -1626,6 +1626,36 @@ class Portal(DBPortal, BasePortal):
@@ -1822,6 +1822,35 @@ class Portal(DBPortal, BasePortal):
msgtype=content.msgtype,
)
@ -34,36 +34,34 @@ index 3b6a81e..c6277a7 100644
+ for sticker in stickers.documents:
+ if sticker.id == int(metadata["id"]):
+ return sticker
+
+
async def _handle_matrix_file(
self,
sender: u.User,
@@ -1646,6 +1676,7 @@ class Portal(DBPortal, BasePortal):
@@ -1842,6 +1871,7 @@ class Portal(DBPortal, BasePortal):
w = h = None
max_image_size = self.config["bridge.image_as_file_size"] * 1000**2
max_image_pixels = self.config["bridge.image_as_file_pixels"]
+ media = None
attributes = []
if self.config["bridge.parallel_file_transfer"] and content.url:
file_handle, file_size = await util.parallel_transfer_to_telegram(
@@ -1666,7 +1697,14 @@ class Portal(DBPortal, BasePortal):
@@ -1863,7 +1893,13 @@ class Portal(DBPortal, BasePortal):
file = await self.main_intent.download_media(content.url)
if content.msgtype == MessageType.STICKER:
- if mime != "image/gif":
- if mime == "image/gif":
+ tg_sticker = None
+
+ if "net.maunium.telegram.sticker" in content.info:
+ tg_sticker = await self._find_telegram_sticker(client, content.info["net.maunium.telegram.sticker"])
+
+ if tg_sticker is not None:
+ media = tg_sticker
+ elif mime != "image/gif":
mime, file, w, h = util.convert_image(
file, source_mime=mime, target_type="webp"
)
@@ -1708,7 +1746,9 @@ class Portal(DBPortal, BasePortal):
+ elif mime == "image/gif":
# Remove sticker description
file_name = "sticker.gif"
else:
@@ -1911,7 +1947,9 @@ class Portal(DBPortal, BasePortal):
if "fi.mau.telegram.force_document" in content:
force_document = bool(content["fi.mau.telegram.force_document"])

View file

@ -1,10 +1,10 @@
{
"url": "https://github.com/mautrix/telegram",
"rev": "f79ab283f3dca1a6d6f17d87c137a229e1f5718e",
"date": "2023-08-03T20:37:01+03:00",
"path": "/nix/store/npfz23j8mjx7ci4f7r64zijx5qhr0nwy-telegram",
"sha256": "0xcwbknkifylqgvpkp0cwsjwqq4fspy39j13bqgc9845c2askpcg",
"hash": "sha256-j92plWCFoMQeXiPINPzVjmDMpeYM3Hn3w9S7OO1cnHU=",
"rev": "1fb8a7a0a50a6cb9c8de2d6dee829c7df9aec076",
"date": "2023-08-08T13:51:28-06:00",
"path": "/nix/store/8jk8wf4qb4mq845c0y21z9g1c6fdvrjd-telegram",
"sha256": "0490qc9yr6x8vk9l01izaah2yvidmznl92kyv5kniknq3dkngjf1",
"hash": "sha256-wclnZxvYzmhn2X6KRO2vLW4voFI/BkDT3Kib7BPDIBE=",
"fetchLFS": false,
"fetchSubmodules": false,
"deepClone": false,

View file

@ -1,6 +1,6 @@
{
"version": "1.20.1",
"build": 108,
"name": "paper-1.20.1-108.jar",
"sha256": "18b3510769ce92f35654595d88bc8ea08446949a707d3fefe8f332d975be5a12"
"build": 115,
"name": "paper-1.20.1-115.jar",
"sha256": "edabd2b27588d189558630084438653d3e0aa650da6c4bae39ae6ff3f6de9eaa"
}