fix: encoding

This commit is contained in:
Tim Schubert 2020-05-30 11:43:38 +02:00
parent 9bf963332c
commit bbe474e78c
Signed by: dadada
GPG key ID: EEB8D1CE62C4DFEA

View file

@ -3,13 +3,18 @@
import asyncio
import email
import pathlib
from os import path, listdir
import sys
import logging
from os import path, listdir
from email.header import decode_header, make_header
from nio import (AsyncClient, Api, ClientConfig, RoomSendError)
from inotify_simple import INotify, flags
def decode(header):
return make_hader(decode_header(header))
class Client(AsyncClient):
def send_message(self, From, Subject):
@ -18,7 +23,7 @@ class Client(AsyncClient):
message_type="m.room.message",
content={
"msgtype": "m.text",
"body": "From:\t%s\nSubject:\t%s" % (From, Subject)
"body": "From:\t%s\nSubject:\t%s" % (decode(From), decode(Subject))
}
)