Commit Graph

60 Commits

Author SHA1 Message Date
Nicolas Werner 1eb2869fa8 Fix stuck unread messages by storing state events in the db
This may increase the db size by a factor of 1000 in the worst case and
it will need some fixes, when we decide to not show some events in the
timeline, but it should work for now.
2020-02-24 01:07:25 +01:00
Nicolas Werner 1b039d0b16 Fix bug in html tag escaping 2020-02-06 22:04:55 +01:00
Nicolas Werner 63f3071445 Remove more unneeded headers 2020-01-31 16:25:43 +01:00
Nicolas Werner 4cd260bfcf Optimize includes a bit 2020-01-31 15:11:21 +01:00
Nicolas Werner b541cecd2e Enable ban and kick button in UserProfile (and try to fix centering) 2020-01-30 03:45:27 +01:00
Nicolas Werner e81a4e8f9a Don't send useless formatted_bodies 2020-01-27 17:25:09 +01:00
Nicolas Werner 8fcb670bde Remove translations from reply fallback 2020-01-24 01:10:40 +01:00
Joseph Donofry 74e2b0725d
Minor tweak to one instance of QSettings not necessarily using the same settings as everything else 2020-01-23 17:07:24 -05:00
Nicolas Werner 1943d1c74d Increase emoji range 2020-01-21 22:36:55 +01:00
Nicolas Werner c95f4d8276 Fix colors in typing display, when username contains emoji 2020-01-21 20:41:09 +01:00
Nicolas Werner 79e4e2e6e1 Improve emoji escaping 2020-01-21 04:18:17 +01:00
Nicolas Werner dc44ac50a3 Linkify links before sending 2020-01-21 03:36:26 +01:00
Nicolas Werner 719f1571b9 Don't require Qt5.12 just for QByteArray::compare 2020-01-16 20:36:44 +01:00
Nicolas Werner 3f02b0bf56 Escape blacklisted html tags 2020-01-14 17:47:30 +01:00
Nicolas Werner 79f967da8c Reduce Cache.h includes further via one forward declaration 2019-12-15 03:34:37 +01:00
Nicolas Werner 5fc1f3bd67 Reduce overhead of Cache.h 2019-12-15 02:56:04 +01:00
Nicolas Werner 659e36b113 Update to c++17 2019-12-14 18:59:38 +01:00
Nicolas Werner 1268e9f11c Make replies format nicer
Also lays a bit of groundwork for better reply rendering
2019-11-23 20:06:15 +01:00
Nicolas Werner 2c37beba8d Fix translation of roomlist message preview
This also makes long messages unreadable, because we don't shorten long
usernames anymore. We may eventually want to do that again, but it is
hard with translations and we probably want to shorten the displayname
more, as before this change the message was only ever as long as the
timestamp, which is usually just 5 characters...
2019-11-23 20:06:15 +01:00
Nicolas Werner cff46d97a8 Add native themeing to QML (where possible) 2019-11-23 20:06:15 +01:00
Nicolas Werner 8727831de7 Fix QML emojis 2019-11-23 20:06:14 +01:00
Michele Guerini Rocco 1659176c0d
escape html before parsing commonmark 2019-09-25 01:18:01 +02:00
Joseph Donofry d5bb0936bf
Use 'system' theme as default if QT_QPA_PLATFORMTHEME is set
On first launch, before the user has configured any settings,
check the value of the QT_QPA_PLATFORMTHEME environment var.
If it is set, use the system theme as the default instead of the
light theme.  This fixes #72.
2019-08-10 13:14:37 -04:00
Nicolas Werner 1c9cc33902 Try to localise timestamps
I'm not sure, if that is the right way, but Qt doesn't really have a way
to format custom localised dates, so I tried to find the closest
approximations to what we currently have.

Relates to #69
2019-07-28 12:55:08 +02:00
Joseph Donofry 86888ee713
Fix bug with emoji font setting and clean linting 2019-07-26 17:44:44 -04:00
Joseph Donofry c0a010acbb
Fix deprecated function call issues with Qt 5.13
Update to mtxclient 0.3.0
2019-07-04 21:20:19 -04:00
Nicolas Werner 40d9b5c5fc Fix santizize=undefined warning (overflow) 2019-06-27 14:57:32 +02:00
Joseph Donofry 129beb57c9
Further Improve Reply Functionality
Quoted replies now include matrix.to links for the event and the user.
UI Rendering has been (slightly) improved... still very WIP.
Restructured the reply structure in the code for future usability
improvements.
2019-06-13 22:33:04 -04:00
Nicolas Werner 23eef9e1bc Simplify linkifyMessage
Parsing html as xml has inherent problems, most notable there are many
matrix clients that don't escape ampersands in urls of mx-replies, etc.
(See issue #18)

This also removes the replacement of <mx-reply> as it isn't strictly
needed.

Also the QRegExp is replaced with the Qt5 QRegularExpression for
perfomance and because it supports lookahead and lookbehind.

I'm pretty sure that the original code also replaced href="" with
href=\"\", which was probably wrong, but I'm not to sure about that.

Fixes #18
2019-05-01 12:11:19 +02:00
redsky17 13663ad5f8 Improve color generation performance
Colors are generated asynchronously now and the TimelineItem is
updated when the color generation finishes.  This allows the UI
to stay responsive while new colors are being generated.
2019-02-08 01:58:00 +00:00
redsky17 2ba51c821e Update user colors to use Cache vs Utils
User colors are now stored in cache.  This is consistent
with other similar variables.  I think there's a bug
right now where it doesn't properly refresh colors
for the TimeLineItem when the theme is changed.
2019-01-26 02:55:07 +00:00
redsky17 237c7ad114 Author Color Fixes
Author color is now cached so that it will not be re-calculated
each time a new message is posted.  This cache gets cleared when
the theme is changed.

Additionally, the author color is now automatically refreshed
when the theme is changed, fixing the issue where you had to
change rooms before the colors would switch.
2019-01-20 04:43:48 +00:00
redsky17 b3f7c13e2f Update user id color generation
Update the author color generation.  Now, instead of generating
an entire hex string based on the user id, the user id instead
is used to generate a hue value.  After this hue value is created,
there is some logic to tweak first the lightness and then saturation
values to achieve a readable color (in contrast to the background).

This change makes it so that user colors will not vary as wildly
between the different themes.

The values still are not cached and still do not update
initially when the theme is changed.  Both of these things
will be resolved.
2019-01-20 00:16:31 +00:00
redsky17 50e382f554 Modified the code that generates user's colors so that it will
work regardless of the theme choices the user makes.  The code
now incorporates the contrast between the background color and the
color generated by the user_name when picking colors.  It currently
has two 'big' issues:
1. Colors are not cached.  I am planning on adding a QHash for this
a little later.  This should improve performance by not calculating
the color for the same users over and over and over again.
2. Theme changes do not trigger the colors to get refreshed.
Currently, you will have to switch to a different room and back
to get the colors to refresh.
2019-01-18 17:17:25 +00:00
redsky17 1882198e4b Make the author text slightly large.
Add author color generated based on user id.
2019-01-18 04:09:42 +00:00
redsky17 55883ec2de Remove the code that removed paragraph tags from markdown -> html.
This fixes #2, but reverts mujx#438.  I do not think mujx#438 was a
valid issue, as it complained about the display of valid HTML on riot,
which speaks more to how Riot styles things than about an issue in
nheko itself.
2019-01-18 00:59:31 +00:00
Konstantinos Sideris aa486a5c0c Adjustments for the minimized sidebar 2018-10-07 14:09:47 +03:00
Konstantinos Sideris 3a57d1018e Add option to configure the font size
fixes #161
2018-10-01 17:56:46 +03:00
Konstantinos Sideris dec643e6ea v0.6.0 2018-09-21 16:44:45 +03:00
Konstantinos Sideris ce26f041ad Add method to center widgets & clean up unused headers 2018-09-21 10:55:24 +03:00
Konstantinos Sideris 1716502eff Improvements on the system theme 2018-09-19 22:42:26 +03:00
Konstantinos Sideris 3e49afd6ba Fix compile warnings 2018-09-18 18:48:14 +03:00
Konstantinos Sideris 8767ea181d Mark unread rooms as such in the room list
fixes #313
2018-09-13 19:15:58 +03:00
Konstantinos Sideris 9f3de8679d Temporary fix to work with mx-reply tags 2018-09-13 16:10:45 +03:00
Konstantinos Sideris bf4d559523 Strip paragraph tags
fixes #438
2018-09-13 11:02:54 +03:00
Konstantinos Sideris dd73a4b278 Trim whitespace from text messages 2018-09-12 14:20:12 +03:00
Konstantinos Sideris a0a76e352b Enable html attributes 2018-09-12 13:40:42 +03:00
Konstantinos Sideris 074608dec1 Switch to libcmark 2018-09-11 14:56:09 +03:00
Konstantinos Sideris 9e8f0b7409 Initial support for sending markdown formatted messages
fixes #283
2018-09-07 20:05:30 +03:00
Konstantinos Sideris a21db789e7 Fix double href links on username pills 2018-09-07 14:52:29 +03:00