An open API service indexing awesome lists of open source software.

https://github.com/Cosium/matrix-communication-client

A java client for the Matrix protocol.
https://github.com/Cosium/matrix-communication-client

matrix

Last synced: 4 months ago
JSON representation

A java client for the Matrix protocol.

Awesome Lists containing this project

README

        

[![Build Status](https://github.com/Cosium/matrix-communication-client/actions/workflows/ci.yml/badge.svg)](https://github.com/Cosium/matrix-communication-client/actions/workflows/ci.yml)
[![Maven Central](https://img.shields.io/maven-central/v/com.cosium.matrix_communication_client/matrix-communication-client.svg)](https://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.cosium.matrix_communication_client%22%20AND%20a%3A%22matrix-communication-client%22)

# Matrix Communication Client

A [Matrix](https://matrix.org/) java client.

# Example

```java
public class Example {

public static void main(String[] args) {
MatrixResources matrix =
MatrixResources.factory()
.builder()
.https()
.hostname("matrix.example.org")
.defaultPort()
.usernamePassword("jdoe", "secret")
.build();

RoomResource room = matrix
.rooms()
.create(
CreateRoomInput.builder()
.name("Science")
.roomAliasName("science")
.topic("Anything about science")
.build());

room.sendMessage(Message.builder().body("Hello !").formattedBody("Hello !").build());
}
}
```

Another example with existing room:

```java
public class Example {

public static void main(String[] args) {
MatrixResources matrix =
MatrixResources.factory()
.builder()
.https()
.hostname("matrix.example.org")
.defaultPort()
.usernamePassword("jdoe", "secret")
.build();

RoomResource room = matrix
.rooms()
.byId("!PVvauSmjcHLwoAJkyT:matrix.example.org");

room.sendMessage(Message.builder().body("Hello !").formattedBody("Hello !").build());
}
}
```

# Dependency

```xml

com.cosium.matrix_communication_client
matrix-communication-client
${matrix-communication-client.version}

```