diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 00000000..ece8c47c
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,103 @@
+name: CI
+
+on:
+ push:
+ pull_request:
+ branches: [ master ]
+
+env:
+ CARGO_TERM_COLOR: always
+
+jobs:
+ style:
+ name: Check style
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout the repo
+ uses: actions/checkout@v2
+
+ - name: Install rust
+ uses: actions-rs/toolchain@v1
+ with:
+ toolchain: stable
+ components: rustfmt
+ profile: minimal
+ override: true
+
+ - name: Cargo fmt
+ uses: actions-rs/cargo@v1
+ with:
+ command: fmt
+ args: --all -- --check
+
+ clippy:
+ name: Run clippy
+ needs: [style]
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout the repo
+ uses: actions/checkout@v2
+
+ - name: Install rust
+ uses: actions-rs/toolchain@v1
+ with:
+ toolchain: stable
+ components: clippy
+ profile: minimal
+ override: true
+
+ - name: Clippy
+ uses: actions-rs/cargo@v1
+ with:
+ command: clippy
+ args: --all-targets -- -D warnings
+
+ test:
+ name: ${{ matrix.name }}
+ needs: [clippy]
+
+ runs-on: ${{ matrix.os || 'ubuntu-latest' }}
+ strategy:
+ matrix:
+ name:
+ - linux / stable
+ - linux / beta
+ - macOS / stable
+ - windows / stable-x86_64-msvc
+
+ include:
+ - name: linux / stable
+
+ - name: linux / beta
+ rust: beta
+
+ - name: macOS / stable
+ os: macOS-latest
+
+ - name: windows / stable-x86_64-msvc
+ os: windows-latest
+ target: x86_64-pc-windows-msvc
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v1
+
+ - name: Install rust
+ uses: actions-rs/toolchain@v1
+ with:
+ toolchain: ${{ matrix.rust || 'stable' }}
+ target: ${{ matrix.target }}
+ profile: minimal
+ override: true
+
+ - name: Build
+ uses: actions-rs/cargo@v1
+ with:
+ command: build
+
+ - name: Test
+ uses: actions-rs/cargo@v1
+ with:
+ command: test
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
new file mode 100644
index 00000000..8b9076e1
--- /dev/null
+++ b/.github/workflows/coverage.yml
@@ -0,0 +1,39 @@
+name: Code coverage
+
+on:
+ push:
+ branches: [ master ]
+
+env:
+ CARGO_TERM_COLOR: always
+
+jobs:
+ code_coverage:
+ name: Code Coverage
+ runs-on: "ubuntu-latest"
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+
+ - name: Install stable toolchain
+ uses: actions-rs/toolchain@v1
+ with:
+ toolchain: stable
+ profile: minimal
+ override: true
+
+ - name: Install tarpaulin
+ uses: actions-rs/cargo@v1
+ with:
+ command: install
+ args: cargo-tarpaulin -f
+
+ - name: Run tarpaulin
+ uses: actions-rs/cargo@v1
+ with:
+ command: tarpaulin
+ args: --ignore-config --exclude-files "matrix_sdk/examples/*,matrix_sdk_common,matrix_sdk_test" --out Xml
+
+ - name: Upload to codecov.io
+ uses: codecov/codecov-action@v1
diff --git a/README.md b/README.md
index 2768c56f..7b5dc261 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-[![Build Status](https://img.shields.io/travis/matrix-org/matrix-rust-sdk.svg?style=flat-square)](https://travis-ci.org/matrix-org/matrix-rust-sdk)
+![Build Status](https://img.shields.io/github/workflow/status/matrix-org/matrix-rust-sdk/CI?style=flat-square)
[![codecov](https://img.shields.io/codecov/c/github/matrix-org/matrix-rust-sdk/master.svg?style=flat-square)](https://codecov.io/gh/matrix-org/matrix-rust-sdk)
[![License](https://img.shields.io/badge/License-Apache%202.0-yellowgreen.svg?style=flat-square)](https://opensource.org/licenses/Apache-2.0)
[![#matrix-rust-sdk](https://img.shields.io/badge/matrix-%23matrix--rust--sdk-blue?style=flat-square)](https://matrix.to/#/#matrix-rust-sdk:matrix.org)
diff --git a/matrix_sdk/src/client.rs b/matrix_sdk/src/client.rs
index 652b8410..0690bea3 100644
--- a/matrix_sdk/src/client.rs
+++ b/matrix_sdk/src/client.rs
@@ -76,6 +76,7 @@ use matrix_sdk_common::{
join_room_by_id, join_room_by_id_or_alias, kick_user, leave_room, Invite3pid,
},
message::{get_message_events, send_message_event},
+ profile::{get_avatar_url, get_display_name, set_avatar_url, set_display_name},
read_marker::set_read_marker,
receipt::create_receipt,
room::create_room,
@@ -430,11 +431,121 @@ impl Client {
session.as_ref().cloned().map(|s| s.user_id)
}
+ /// Fetches the display name of the owner of the client.
+ ///
+ /// # Example
+ /// ```no_run
+ /// # use futures::executor::block_on;
+ /// # use matrix_sdk::Client;
+ /// # use url::Url;
+ /// # let homeserver = Url::parse("http://example.com").unwrap();
+ /// # block_on(async {
+ /// let user = "example";
+ /// let client = Client::new(homeserver).unwrap();
+ /// client.login(user, "password", None, None).await.unwrap();
+ ///
+ /// if let Some(name) = client.display_name().await.unwrap() {
+ /// println!("Logged in as user '{}' with display name '{}'", user, name);
+ /// }
+ /// # })
+ /// ```
+ pub async fn display_name(&self) -> Result