Commit graph

1323 commits

Author SHA1 Message Date
Eisha Chen-yen-su
a1fa6acf3f UI: Add GtkTextView for listing invites
See https://gitlab.gnome.org/World/fractal/issues/78
2018-10-06 13:24:49 +02:00
Jordan Petridis
94ed965130
Flatpak: Configure libhandy
We don't need to build the tests, examples, vapi or docs in the
flatpak build. They are just not useful when you embed the
dependency.
2018-10-06 04:45:34 +03:00
Jordan Petridis
9fc14cb54f
Meson: capture the output of the custom target
Previously meson would withhold the stdout output, and only
print it once the job was finished. This was a bit problematic
with the current way we wire cargo into meson, cause you have
no output of whats going on till then causing a degraded UX.

With this change output is printed directly to stdout and
behaves as expected.

https://mesonbuild.com/Reference-manual.html#custom_target
2018-10-06 04:31:30 +03:00
Daniel Garcia Moreno
7ee9693666 Merge branch 'cache' into 'master'
Cache

See merge request World/fractal!241
2018-10-05 08:52:16 +00:00
Daniel García Moreno
cfba73487d Update Cargo.lock 2018-10-05 09:28:03 +02:00
Daniel García Moreno
5ee47258d3 cache: tag not used methods to avoid compile warning 2018-10-05 09:14:49 +02:00
Daniel García Moreno
faa0a12bc4 cache: Better name for cache mutex unwrap 2018-10-05 09:14:49 +02:00
Daniel García Moreno
1fc333b447 cache: Use mdl cache instead of json
With this change we're using lmdb as the cache storage and it works.

In this case we're not using the AppMsg cache model to store messages,
we're storing all the room with all the msgs.

In the future will be better to split that in two, so it'll be faster to
add, delete or update a room message, because with this version any of
those operations requires to serialize the whole message array again.
2018-10-05 09:14:49 +02:00
Daniel García Moreno
ada758a33a cache: First steps to use lmdb cache 2018-10-05 09:14:49 +02:00
Daniel Garcia Moreno
b0177d0feb Merge branch 'jsparber/handy' into 'master'
Use HdyColumn

See merge request World/fractal!191
2018-10-05 07:13:31 +00:00
Marek Černocký
187da67a39 Update Czech translation 2018-10-03 13:17:47 +00:00
Jordan Petridis
70f8475112
Column: set linear_grouwth_width 2018-10-03 14:53:11 +03:00
Jordan Petridis
d11221dc0d
App: Use the new SVEntry struct instead of GtkBuilder
Its possible to make rust structs for each widget and add those to
the UI struct instead of going through GtkBuilder to access every
widget.

This, along with the previous commit, shows an easy pattern that can
be followed to abstract the elements and refactor the codebase
gradually.

A similar pattern was also demonstated by Federico in his GUADEC
2018 talk "Patterns of refactoring C to Rust" [1]. I Highly
recommened watching it.

[1] https://www.youtube.com/watch?v=5mVMycYmoWE
2018-10-03 14:53:08 +03:00
Jordan Petridis
cd5a1e86a7
SourceViewEntry: Move it to its own widget 2018-10-01 08:32:57 +03:00
Jordan Petridis
4841efa75c
SourceViewEntry: Add another bin like parent
There seemed to be a weird line drawn from the style class before
this.
2018-10-01 08:32:57 +03:00
Jordan Petridis
ecefd2cc51
SourceViewEntry: Use HdyColumn to center it
This is a reimplementation of the widget that existed in the gtkbuilder
(.ui) file. The end goal is to start moving everything in its own
declaration and use actuall Rust structs instead of the GtkBuilder
to access the widgets.

For the time being the widgets are exposed to the builder object in
order to make the refactoring proccess easier and not brake the world.
2018-10-01 08:32:56 +03:00
Jordan Petridis
8fbbe05b99
Room Directory: Add top margin 2018-10-01 08:32:56 +03:00
Jordan Petridis
4d0d69f46a
Put the room directory inside a HdyColumn 2018-10-01 08:32:56 +03:00
Julian Sparber
9e789d490f
column: change message list background to white 2018-10-01 08:32:47 +03:00
Julian Sparber
158f4c24a5
column: add libhandy column to message view 2018-10-01 08:32:41 +03:00
Daniel Garcia Moreno
4ecc102962 Merge branch 'initial-sync-filter' into 'master'
Add filter to sync for initial sync

See merge request World/fractal!240
2018-09-28 06:40:10 +00:00
Daniel García Moreno
889383dbf8 Add filter to sync for initial sync 2018-09-27 20:23:58 +02:00
Daniel García Moreno
6c565f6e0b roomhistory: Remove build warnings
The room param for the RoomHistory was calculated using the AppOp, but
we're getting this in the new method params, so we can use directly the
room variable.
2018-09-26 10:44:22 +02:00
Daniel García Moreno
c1e84ba973 Fix load more in the new room history and fast sync
With the remove of the initial sync without a since param and the store
of the prev_batch for each room, the load_more messages isn't working
correctly.

I've detected two issues that this patch fixes:

1. The first problem is that it's possible to have rooms that doesn't
have the prev_batch, I'm solving this with a new backend call that loads
more using the last messages id and in the case that a new room doesn't
have messages we can use the last sync batch.

2. The second problem is when you load more, close and open again
Fractal, if you go to load more, the prev_batch is the last one so we're
not loading the corresponding messages, we continue loading from the
last one that's not what is showed. This is because at close we're
storing the last batch in cache, but we're only storing the last 40
messages. To solve this, I'm setting the prev_batch to None at store in
the cache so the first time we'll try to get more messages using the
last message id.
2018-09-26 10:35:12 +02:00
Julian Sparber
18262cb937 roomhistory: fix possible crash
This removes a unwrap
2018-09-25 18:06:40 +02:00
Julian Sparber
b5e71d57df roomhistory: fix listbox fill scrolledwindow 2018-09-25 16:35:50 +02:00
Julian Sparber
09f1b248cb roomhistory: use double ended Vector to store messages
- lazy load old messages on top of the history,
  and make sure they are loaded after initial messages
2018-09-25 16:35:50 +02:00
Julian Sparber
51bb89b43d roomhistory: fix loading wrong messages to room history
Once a new room was created the lazy loading closure kept loding
messages the the message history even when the room changed.
2018-09-25 16:35:48 +02:00
Julian Sparber
9e8262a41b roomhistory: cleanup old code 2018-09-25 16:15:37 +02:00
Julian Sparber
f7c15f4be7 roomhistory: remove loading spinner form room history 2018-09-25 16:07:39 +02:00
Julian Sparber
09608c7daf roomhistory: lazy load all stored room messages
Since the messages are lazy loaded, we can load all cached messages
when a room gets opened
2018-09-25 16:07:39 +02:00
Julian Sparber
b3d17f8d24 roomhistory: add custom widget for message history
The new widget for the history keeps track of the the messages in the
list, therefore it can update a message and how a message is displayed
It also adds lacy loading of a new message batch or cached messages (not
yet in use)
2018-09-25 16:07:39 +02:00
Daniel Garcia Moreno
10224b4655 Merge branch 'search' into 'master'
backend: remove outdated code

See merge request World/fractal!239
2018-09-25 13:35:33 +00:00
Julian Sparber
f7beaefb07 room: remove outdated code and cleanup
This removes outdated code to simplify the codebase, it makes it easier
to read.
2018-09-25 14:44:43 +02:00
Julian Sparber
976ed8d945 backend: remove outdated code for search
This removes outdated code, which was used to make search requests to
the server.
2018-09-25 12:15:19 +02:00
Daniel Garcia Moreno
766d38d91c Merge branch 'top' into 'master'
backend: get previous message with get messages api

See merge request World/fractal!237
2018-09-25 06:44:02 +00:00
Julian Sparber
899071ed7b backend: get previous message with get messages api
This replaces the get_context API call with the correct API to get older messages.
2018-09-24 18:32:07 +02:00
Jordan Petridis
e92bc69f33 Merge branch 'since_fix' into 'master'
store: make sure that since value is never empty

See merge request World/fractal!236
2018-09-24 15:23:59 +00:00
Julian Sparber
5b1989480b store: make sure that since value is never empty
this fixes initial sync fail because since is a empty string
2018-09-24 16:31:07 +02:00
Daniel García Moreno
cfa2245e65 Remove not needed mut 2018-09-24 13:48:50 +02:00
Daniel Garcia Moreno
845ddb4ab0 Merge branch 'since' into 'master'
Continue sync when reopeing fractal (makes first sync much faster)

See merge request World/fractal!232
2018-09-24 07:51:06 +00:00
Daniel García Moreno
861f8b2447 Remove not needed use Utc 2018-09-24 09:46:23 +02:00
Daniel García Moreno
4075ab9b63 Remove non needed to_string() for slice string 2018-09-24 09:45:20 +02:00
Daniel Garcia Moreno
3645d56430 Merge branch 'origin_server_ts' into 'master'
Made the code use origin_server_ts instead of age to calculate messages

See merge request World/fractal!235
2018-09-24 07:35:45 +00:00
Daniel Garcia Moreno
151edb8ff4 Merge branch 'utf8-selection' into 'master'
Fixed incorrect string slicing that would screw up UTF-8 strings

Closes #335

See merge request World/fractal!234
2018-09-24 07:03:23 +00:00
Rasmus Rendal
ae2206e612 Added spaces in division 2018-09-24 06:59:04 +00:00
Daniel Garcia Moreno
1793baba4c Merge branch 'uid_label' into 'master'
Uid label

Closes #318

See merge request World/fractal!233
2018-09-24 06:40:21 +00:00
Rasmus Rendal
8b1adf98ac Merge branch 'origin_server_ts' of https://gitlab.gnome.org/RasmusRendal/fractal into origin_server_ts 2018-09-23 20:39:09 +02:00
Rasmus Rendal
45e46b5b9a Made the code use origin_server_ts instead of age to calculate messages 2018-09-23 20:37:21 +02:00
Rasmus Rendal
b3d7d8906f Made the code use origin_server_ts instead of age to calculate messages 2018-09-23 20:16:50 +02:00