Commit graph

1506 commits

Author SHA1 Message Date
Alejandro Domínguez
09f504471c Backend: Use Url type in BackendData.server_url 2019-01-13 11:21:54 +00:00
Alejandro Domínguez
48ffd7bd6e Backend: Use slices instead of references to immutable vectors where possible 2019-01-12 16:06:57 +00:00
Piotr Drąg
9017488331 Update Polish translation 2019-01-12 12:42:51 +01:00
Alejandro Domínguez
e3fba68591 Backend: Stop depending on cairo for cache_dir_path() and use directories instead 2019-01-09 21:45:20 +00:00
Alejandro Domínguez
a87d712fe4 Backend: Cairo is unused, don't depend on it 2019-01-09 21:45:20 +00:00
Alejandro Domínguez
47fdc3f58e Backend: Change function signatures to mutable vectors instead of cloning internally 2019-01-09 20:21:23 +00:00
Piotr Drąg
f8ed2088f4 Update POTFILES.in 2019-01-09 19:50:12 +01:00
Julian Sparber
8afbc5cd15 attach: use common filechooser widget to attach file 2019-01-08 17:58:04 +01:00
Julian Sparber
985782b3b3 file dialog: add a common filepicker dialog 2019-01-08 17:57:10 +01:00
Alejandro Domínguez
ff7e6df126 Backend: Use get!, post! and put! as much as possible 2019-01-08 14:17:32 +00:00
Alejandro Domínguez
ef6f0275c1 Backend: Add put! macro 2019-01-08 14:17:32 +00:00
Alejandro Domínguez
2144566a2d Backend: Refactor get! and post! 2019-01-08 14:17:32 +00:00
Daniel Garcia
bd0afef09d Updated Spanish translation 2019-01-08 09:54:43 +01:00
Anders Jonsson
ec53fe1ab9 Update Swedish translation 2019-01-07 22:03:05 +00:00
Alejandro Domínguez
ff7744efc0 Use .unwrap_or_default() instead of .unwrap_or() where possible 2019-01-06 17:48:37 +01:00
Alejandro Domínguez
043e7f5d44 Call String::new() instead of String::from("") or "".to_string() 2019-01-06 17:26:12 +01:00
Alejandro Domínguez
09894a81b6 Fix warning: unused mut 2019-01-06 04:13:33 +00:00
Alejandro Domínguez
280d585a25 Reformat Cargo.toml 2019-01-06 04:13:32 +00:00
Alejandro Domínguez
36b090533b Remove redundant uses 2019-01-06 04:13:32 +00:00
Alejandro Domínguez
84b7026b2f Upgrade to Rust 2018 2019-01-06 04:13:32 +00:00
Julian Sparber
4205a6a980 rooms: cache rooms only when the roomlist is cleared 2019-01-05 15:29:15 +00:00
Jordan Petridis
5dae373c85
meson: remove dependency on libsecret
This was added by accident, the secret-serivce crate is pure rust
and does not depend upon libsecret.
2019-01-05 16:01:15 +02:00
Jordan Petridis
e78f36c25c
meson: remove dependency on gstreamer-bad-video-1.0
This has been moved to gst-base now.
b9e15fddb1
2019-01-05 15:46:56 +02:00
Julian Sparber
78dfdc1e97 room: open default room when avaible 2019-01-02 22:54:18 +01:00
Julian Sparber
0ea988a0f3 refactor: simplify how rooms are added to the roomlist
This removes many clones and loops which where not needed.
2019-01-02 22:54:18 +01:00
Julian Sparber
f32f9cee64 refactor: pass rooms to set_rooms by value 2019-01-02 22:54:18 +01:00
Alejandro Domínguez
0bd8a9f6ba Fixes unchecked bug in e52fca475c 2019-01-02 18:35:38 +01:00
Alejandro Domínguez
e52fca475c Backend: Use lazy_static! for Regex evaluation. Closes #391 2018-12-29 22:56:12 +01:00
Alexandre Franke
30809bccd1 Update French translation 2018-12-29 18:56:38 +00:00
Jordi Mas
4a8de6a5bb Update Catalan translation 2018-12-29 18:52:25 +01:00
Alexandre Franke
4df848370c Fix mentions of World since we moved 2018-12-28 12:44:30 +01:00
Rafael Fontenelle
4003f6d515 Update Brazilian Portuguese translation 2018-12-25 18:33:55 +00:00
Piotr Drąg
3cbbad2ec5 Update Polish translation 2018-12-24 14:39:43 +01:00
Tobias Bernard
aa9b48cad3 Invite Dialogs: minor visual fixes
- Fix the search results not expanding
- Fix the spacing around the searchbar

The two UI files are identical except for some labels and IDs and should
be merged
2018-12-24 09:53:34 +00:00
Julian Sparber
13ccd74276 roomhistory: fix date format in day divider 2018-12-23 15:43:38 +00:00
Zeeshan Ali
f701ea559c fractal-matrix-api: Drop a redundant conversion
This fixes this errors from clippy:

```
warning: identical conversion
  --> fractal-matrix-api/src/backend/sync.rs:53:32
   |
53 |         params.push(("filter", String::from(filter)));
   |                                ^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `filter`
   |
   = help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/master/index.html#identity_conversion
```

Related: #370
2018-12-23 10:50:10 +00:00
Zeeshan Ali
5295964b6a fractal-matrix-api: Don't call a function in Result::unwrap() arg
This fixes this errors from clippy:

```
warning: use of `unwrap_or` followed by a call to `new`
  --> fractal-matrix-api/src/backend/room.rs:80:30
   |
80 |                       avatar = util::get_room_avatar(&baseu, &tk, &userid, &roomid)
   |  ______________________________^
81 | |                         .unwrap_or(String::from(""));
   | |_________________________________________________^ help: try this: `util::get_room_avatar(&baseu, &tk, &userid, &roomid).unwrap_or_default()`
   |
   = note: #[warn(clippy::or_fun_call)] on by default
   = help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/master/index.html#or_fun_call
```

Related: #370
2018-12-23 10:50:09 +00:00
Zeeshan Ali
7152795796 fractal-matrix-api: Use char type for single char patterns
This fixes this errors from clippy:

```
error: single-character string constant used as pattern
   --> fractal-matrix-api/src/backend/media.rs:119:30
    |
119 |         let name = url.split("/").last().unwrap_or_default();
    |                              ^^^ help: try using a char instead: `'/'`
    |
    = note: `-D clippy::single-char-pattern` implied by `-D warnings`
    = help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/master/index.html#single_char_pattern
```

Related: #370
2018-12-23 10:50:09 +00:00
Zeeshan Ali
b93f1e4420 fractal-matrix-api: More idiomatic if/else assignments
This fixes these errors from clippy:

```
error: `if _ { .. } else { .. }` is an expression
   --> fractal-matrix-api/src/util.rs:525:5
    |
525 | /     let path: String;
526 | |
527 | |     if thumb {
528 | |         params.push(("width", format!("{}", w)));
...   |
533 | |         path = format!("download/{}/{}", server, media);
534 | |     }
    | |_____^ help: it is more idiomatic to write: `let path = if thumb { ..; $ crate :: fmt :: format ( format_args ! ( $ ( $ arg ) * ) ) } else { $ crate :: fmt :: format ( format_args ! ( $ ( $ arg ) * ) ) };`
    |
    = note: `-D clippy::useless-let-if-seq` implied by `-D warnings`
    = help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/master/index.html#useless_let_if_seq
```

Related: #370
2018-12-23 10:50:09 +00:00
Zeeshan Ali
01068ad752 fractal-matrix-api: Remove length comparisons to zero
This fixes some errors from clippy about needless length comparison to 0:

```
error: length comparison to zero
   --> fractal-matrix-api/src/util.rs:483:27
    |
483 |     if array.is_none() || array.unwrap().len() == 0 {
    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `array.unwrap().is_empty()`
    |
    = note: `-D clippy::len-zero` implied by `-D warnings`
    = help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/master/index.html#len_zero
```

Related: #370
2018-12-23 10:50:09 +00:00
Zeeshan Ali
2ab29cfe69 fractal-matrix-api: Don't pass by value unnecessarily
This patch fixes a big bunch of 'unnecessary pass by value' errors from clippy:

```
error: this argument is passed by value, but not consumed in the function body
   --> fractal-matrix-api/src/util.rs:340:9
    |
340 |     tk: String,
    |         ^^^^^^
    |
    = note: `-D clippy::needless-pass-by-value` implied by `-D warnings`
    = help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/master/index.html#needless_pass_by_value
help: consider changing the type to
    |
340 |     tk: &str,
    |         ^^^^
help: change `tk.clone()` to
    |
357 |                 tk.to_string(),
    |                 ^^^^^^^^^^^^^^
```

Related: #370
2018-12-23 10:50:09 +00:00
Zeeshan Ali
d3d5f91cd8 fractal-matrix-api: Drop unit closure
Fixing clippy error:

```
error: called `map(f)` on an Option value where `f` is a unit closure
   --> fractal-matrix-api/src/util.rs:248:17
    |
248 | /                 fread["content"]["event_id"]
249 | |                     .as_str()
250 | |                     .map(|ev| r.add_receipt_from_fully_read(userid, ev));
    | |________________________________________________________________________^
    |
    = note: `-D clippy::option-map-unit-fn` implied by `-D warnings`
    = help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/master/index.html#option_map_unit_fn
help: try this
    |
248 |                 if let Some(ev) = fread["content"]["event_id"]
249 |                     .as_str() { r.add_receipt_from_fully_read(userid, ev) }
    |

```

Related: #370
2018-12-23 10:50:09 +00:00
Zeeshan Ali
903ee29aea fractal-matrix-api: Drop redundant function call
Fixing clippy error:

```
error: called `filter(p).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(p)` instead.
   --> fractal-matrix-api/src/util.rs:243:34
    |
243 |               if let Some(fread) = evs
    |  __________________________________^
244 | |                 .into_iter()
245 | |                 .filter(|x| x["type"] == "m.fully_read")
246 | |                 .next()
    | |_______________________^
    |
    = note: `-D clippy::filter-next` implied by `-D warnings`
    = note: replace `filter(|x| x["type"] == "m.fully_read").next()` with `find(|x| x["type"] == "m.fully_read")`
    = help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/master/index.html#filter_next
```

Related: #370
2018-12-23 10:50:09 +00:00
Zeeshan Ali
ae52f0e5bb fractal-matrix-api: Drop redundant pattern matching
Fixing clippy error:

```
error: redundant pattern matching, consider using `is_some()`
   --> fractal-matrix-api/src/util.rs:223:24
    |
223 |                   if let Some(_) = tag["content"]["tags"]["m.favourite"].as_object() {
    |  _________________-      ^^^^^^^
224 | |                     r.fav = true;
225 | |                 }
    | |_________________- help: try this: `if tag["content"]["tags"]["m.favourite"].as_object().is_some()`
    |
    = note: `-D clippy::redundant-pattern-matching` implied by `-D warnings`
    = help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/master/index.html#redundant_pattern_matching

```

Related: #370
2018-12-23 10:50:09 +00:00
Zeeshan Ali
4d34eed4ab fractal-matrix-api: Drop redundant closures
Fixing clippy error:

```
error: redundant closure found
   --> fractal-matrix-api/src/util.rs:219:60
    |
219 |         r.prev_batch = timeline["prev_batch"].as_str().map(|s| String::from(s));
    |                                                            ^^^^^^^^^^^^^^^^^^^ help: remove closure as shown: `String::from`
    |
    = note: `-D clippy::redundant-closure` implied by `-D warnings`
    = help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/master/index.html#redundant_closure
```

Related: #370
2018-12-23 10:50:09 +00:00
Zeeshan Ali
14e7d2fcf5 fractal-matrix-api: Drop redundant field initializations
Fixing clippy error:

```
error: redundant field names in struct initialization
  --> fractal-matrix-api/src/backend/mod.rs:47:13
   |
47 |             tx: tx,
   |             ^^^^^^ help: replace it with: `tx`
   |
   = note: `-D clippy::redundant-field-names` implied by `-D warnings`
   = help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/master/index.html#redundant_field_names

error: redundant field names in struct initialization
  --> fractal-matrix-api/src/model/room.rs:37:13
   |
37 |             id: id,
   |             ^^^^^^ help: replace it with: `id`
   |
   = help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/master/index.html#redundant_field_names

error: redundant field names in struct initialization
  --> fractal-matrix-api/src/model/room.rs:38:13
   |
38 |             name: name,
   |             ^^^^^^^^^^ help: replace it with: `name`
   |
   = help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/master/index.html#redundant_field_names
```

Related: #370
2018-12-23 10:50:09 +00:00
Zeeshan Ali
bdadb58c52 fractal-matrix-api: Don't loop for unwrapping Option
Fixing clippy error:

```
error: for loop over `dataevs.as_array()`, which is an `Option`. This is more readably written as an `if let` statement.
   --> fractal-matrix-api/src/util.rs:221:19
    |
221 |         for ev in dataevs.as_array() {
    |                   ^^^^^^^^^^^^^^^^^^
    |
    = note: #[deny(clippy::for_loop_over_option)] on by default
    = help: consider replacing `for ev in dataevs.as_array()` with `if let Some(ev) = dataevs.as_array()`
    = help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/master/index.html#for_loop_over_option
```

Related: #370
2018-12-23 10:50:09 +00:00
Hubert Figuière
2c1cf4b6d0 flatpak: Update git URL for fractal 2018-12-22 14:52:38 -05:00
Alexandre Franke
0ff5924445 Update README 2018-12-22 19:53:12 +01:00
Daniel García Moreno
5c0f17a42c Release 4.0.0 2018-12-22 11:19:34 +01:00