Commit Graph

204 Commits

Author SHA1 Message Date
miruka
2d682516e8 Support encrypted file reading & caching
Also don't convert palette images to JPEG when creating thumbnails.
2019-11-04 14:37:48 -04:00
miruka
de8d0b5823 Fix image events opened/copied url 2019-11-04 10:46:06 -04:00
miruka
02c6ec4500 Implement Media download 2019-11-04 10:29:18 -04:00
miruka
484eefe86d Fix image URL preview, add Thumbnail.create()
- Make HMxcImage's mxc property work with http too (temporary quick
solution)

- Thumbnail objects can now be initialized with existing bytes and not
  have to download anything.
2019-11-04 07:00:28 -04:00
miruka
337603595a Backend: separate wait_until_(any_?)client_exists() 2019-11-04 06:56:26 -04:00
miruka
e1600389fc Upload 800x600 thumbnails instead of 512x512
Maximum thumbnail size, match Riot's behavior.
2019-11-03 14:08:29 -04:00
miruka
2f19ff493b Rewrite media caching (old image provider)
- Doesn't use pyotherside's image provider feature, for more flexibility
  and simplicity
- Suitable for supporting matrix media events and more later
- Avoid a lot of duplicate files that the old cache created due to
  server not returning what we expect, mistakes in Python/QML code, etc
- Changed file structure
  (e.g. thumbnails/32x32/<mxc id> instead of
   thumbnails/<mxc id>.32.32.crop)

- Backend.wait_until_account_exist: start issuing warnings if the
  function runs for more than 10s, which means in most case a bad user
  ID was passed

- New HMxcImage QML component, used in H(User/Room)Avatar
2019-11-03 13:48:12 -04:00
miruka
b9fbd36661 Restart sync if exception occurs 2019-10-30 11:15:35 -04:00
miruka
ce2a7f1018 Support encrypting uploads
For files and thumbnails.
Also fix the PIL thumbnail() bad argument function call.
2019-10-30 10:34:20 -04:00
miruka
b11c9d5675 Use lanczos filter and optimize saved thumbnail 2019-10-30 05:47:22 -04:00
miruka
adeec71fac Log warning when thumbnailing fails 2019-10-30 05:36:54 -04:00
miruka
48bcc91582 Never upscale images when thumbnailing 2019-10-30 05:34:32 -04:00
miruka
412a86762e Generate thumbnail when uploading images 2019-10-29 16:42:56 -04:00
miruka
7a5a1fc650 Print python exception tracebacks 2019-10-29 13:34:55 -04:00
miruka
001d6eff71 Initial upload implementation 2019-10-28 15:27:36 -04:00
miruka
820cc68373 Rename MatrixClient.send_markdown() to send_text
Because it deals with text command parsing too
2019-10-28 13:51:46 -04:00
miruka
662b60d7a8 Separate _function for local echoing 2019-10-28 13:49:55 -04:00
miruka
09a50f8bc7 Separate _function for general message sending 2019-10-28 13:34:59 -04:00
miruka
6eb3a378bc Proper upload exceptions, handle in QML set avatar 2019-10-28 08:06:22 -04:00
miruka
5894481dc5 Python exceptions can now be handled via QML
callCoro/callBackendCoro can now take onSuccess(result) and
onError(type, args, errorObject) callbacks.
2019-10-28 06:26:02 -04:00
miruka
07e6d74b91 Fix HTML escaping for markdown parsing
Use mistune's escape option instead of `html.escape()` which messes up
links.
2019-10-27 12:06:19 -04:00
miruka
7090ff601f Don't have local echoes stay fixed at the bottom 2019-10-24 10:28:07 -04:00
miruka
986e39cdc2 Fix quotes rendering in inline filtered html
Before:
a
>x
b
>z

This message would have been shown all gray in the client due to it not
beginning with a >. Now, the colors are properly shown for both quotes
and the non-quote text in between.
2019-10-24 09:43:40 -04:00
miruka
39b4706c75 Have return symbols in inline filtered html
Before: "foo\nbar" was rendered as "foobar"
Now: "foo\nbar" is rendered as "foo ⏎ bar" (U+23CE unicode).
2019-10-24 09:08:10 -04:00
miruka
5522de5165 html_filter: don't remove \n in <pre> content 2019-10-24 08:06:50 -04:00
miruka
c4b05befa4 html_filter: html escape markdown before filtering
Fixes the problem where a user sends e.g. "hi <test>" and the "<test>" is
removed because it's seen as a bad html tag.
2019-10-24 07:27:13 -04:00
miruka
d20ab5a348 Refactor EventContent
Use proper layouts and get rid of multiple annoyances/bugs like
text-wrapping randomly happening in the middle of words, background
rectangles being too large, a certain binding loop, etc
2019-09-19 15:49:29 -04:00
miruka
f19d337817 Move hover preview height from settings to theme 2019-09-17 16:39:45 -04:00
miruka
692749e72f Support video events, new media player 2019-09-17 16:30:04 -04:00
miruka
451038641e Display RoomMessageImage events 2019-09-14 00:46:54 -04:00
miruka
0db34cc3c8 Add EventMediaLoader
Handles loading of URL previews and will handle all
matrix media messages types.
2019-09-14 00:36:19 -04:00
miruka
8ad13b033d Event: optional (inline_)content, auto-gen inline 2019-09-13 23:02:11 -04:00
miruka
a5095274ba MatrixClient: RoomMessageMedia support 2019-09-13 22:48:33 -04:00
miruka
a2ab7b3090 Add event callback for RoomUnknownMessage 2019-09-13 19:58:45 -04:00
miruka
d3a02deb46 Update version to 0.2.3 2019-09-12 20:59:12 -04:00
miruka
0b60b2b5bc Add autoplay GIF setting 2019-09-12 17:32:48 -04:00
miruka
f8811f4e0c Disable underscore emphasis syntaxes for markdown 2019-09-11 17:25:50 -04:00
miruka
0e6b6c830d Support inline HTML/links for room topic 2019-09-11 16:01:37 -04:00
miruka
72bcb9bbe3 Update version to v0.2.2 2019-09-10 22:07:41 -04:00
miruka
60663ed040 Leave non-image links out from Event.previe_links
normal links preview isn't implemented yet, which caused any message
with a link to take at least 256px due to the preview repeater.
2019-09-10 22:07:06 -04:00
miruka
7797b0e1eb HtmlFilter: Remove excess newlines
To avoid additional blank lines with HTML/CSS using `white-space: pre`
2019-09-10 21:22:42 -04:00
miruka
b3135601ed Stop supporting starting without pyotherside 2019-09-10 20:49:01 -04:00
miruka
d6b8fae30a matrix_client: leave room before forgetting it 2019-09-10 01:34:01 -04:00
miruka
988ab94772 Fix ForgetRoomPopup destruction/callback 2019-09-09 20:56:10 -04:00
miruka
7c0bed79a9 ImportKeys/ExportKeys separate dialog componants 2019-09-09 14:42:58 -04:00
miruka
6b26aa6d0b load_past_events: Catch RoomMessagesError 2019-09-09 08:26:09 -04:00
miruka
aefb314999 Fix exporting key to a path that doesn't exist yet 2019-09-08 12:17:08 -04:00
miruka
e93c251624 Add clear messages shortcut 2019-09-08 11:51:03 -04:00
miruka
db0de237e6 Add message context menu entry to clear events 2019-09-08 11:40:39 -04:00
miruka
405573bb2d Fix room subtitle quotes: second+ quote not green 2019-09-08 10:48:58 -04:00