Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
stickerpicker
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Wiki externe
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Registre de conteneurs
Registre de modèles
Opération
Environnements
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
salixor
stickerpicker
Validations
6e6aad04
Valider
6e6aad04
rédigé
5 sept. 2020
par
Tulir Asokan
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Add more Element iOS compatibility (ref #8)
parent
47f3d3fd
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
2
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
import.py
+4
-1
4 ajouts, 1 suppression
import.py
web/widget-api.js
+18
-4
18 ajouts, 4 suppressions
web/widget-api.js
avec
22 ajouts
et
5 suppressions
import.py
+
4
−
1
Voir le fichier @
6e6aad04
...
...
@@ -3,7 +3,7 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from
typing
import
Dict
,
TypedDict
from
typing
import
Dict
,
TypedDict
,
Optional
from
io
import
BytesIO
import
argparse
import
os.path
...
...
@@ -75,6 +75,8 @@ class MatrixMediaInfo(TypedDict):
h
:
int
size
:
int
mimetype
:
str
thumbnail_url
:
Optional
[
str
]
thumbnail_info
:
Optional
[
'
MatrixMediaInfo
'
]
class
MatrixStickerInfo
(
TypedDict
,
total
=
False
):
...
...
@@ -122,6 +124,7 @@ async def reupload_document(client: TelegramClient, document: Document) -> Matri
"
w
"
:
width
,
"
h
"
:
height
,
"
size
"
:
len
(
data
),
"
mimetype
"
:
"
image/png
"
,
},
},
}
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
web/widget-api.js
+
18
−
4
Voir le fichier @
6e6aad04
...
...
@@ -34,14 +34,28 @@ window.onmessage = event => {
}
export
function
sendSticker
(
content
)
{
const
data
=
{
content
,
// `name` is for Element Web (and also the spec)
// Element Android uses content -> body as the name
name
:
content
.
body
,
}
// This is for Element iOS
const
widgetData
=
{
...
data
,
description
:
content
.
body
,
file
:
`
${
content
[
"
net.maunium.telegram.sticker
"
].
id
}
.png`
,
}
// Element iOS explodes if there are extra fields present
delete
widgetData
.
content
[
"
net.maunium.telegram.sticker
"
]
window
.
parent
.
postMessage
({
api
:
"
fromWidget
"
,
action
:
"
m.sticker
"
,
requestId
:
`sticker-
${
Date
.
now
()}
`
,
widgetId
,
data
:
{
name
:
content
.
body
,
content
,
},
data
,
widgetData
,
},
"
*
"
)
}
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Please
se connecter
to comment