Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Add basic implementation for the presence endpoints. #137

Merged
merged 2 commits into from
Feb 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ r2d2 = "0.7.1"
r2d2-diesel = "0.9.0"
rand = "0.3.15"
router = "0.4.0"
ruma-events = "0.2.0"
ruma-events = "0.3.0"
rustc-serialize = "0.3.21"
serde = "0.8.21"
serde_derive = "0.8.21"
Expand Down
14 changes: 7 additions & 7 deletions STATUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,22 +296,22 @@ Legend:
<th align="left" colspan="3">Presence</th>
</tr>
<tr>
<td align="center">:no_entry_sign:</td>
<td align="center">:construction:</td>
<td><a href="https://github.com/ruma/ruma/issues/39">#39</a></td>
<td>PUT /presence/:user_id/status</td>
</tr>
<tr>
<td align="center">:no_entry_sign:</td>
<td align="center">:construction:</td>
<td><a href="https://github.com/ruma/ruma/issues/40">#40</a></td>
<td>GET /presence/:user_id/status</td>
</tr>
<tr>
<td align="center">:no_entry_sign:</td>
<td align="center">:construction:</td>
<td><a href="https://github.com/ruma/ruma/issues/41">#41</a></td>
<td>POST /presence/list/:user_id</td>
</tr>
<tr>
<td align="center">:no_entry_sign:</td>
<td align="center">:construction:</td>
<td><a href="https://github.com/ruma/ruma/issues/42">#42</a></td>
<td>GET /presence/list/:user_id</td>
</tr>
Expand Down Expand Up @@ -417,17 +417,17 @@ Legend:
<th align="left" colspan="3">Room tagging</th>
</tr>
<tr>
<td align="center">:no_entry_sign:</td>
<td align="center">:white_check_mark:</td>
<td><a href="https://github.com/ruma/ruma/issues/59">#59</a></td>
<td>PUT /user/:user_id/rooms/:room_id/tags/:tag</td>
</tr>
<tr>
<td align="center">:no_entry_sign:</td>
<td align="center">:white_check_mark:</td>
<td><a href="https://github.com/ruma/ruma/issues/60">#60</a></td>
<td>DELETE /user/:user_id/rooms/:room_id/tags/:tag</td>
</tr>
<tr>
<td align="center">:no_entry_sign:</td>
<td align="center">:white_check_mark:</td>
<td><a href="https://github.com/ruma/ruma/issues/61">#61</a></td>
<td>GET /user/:user_id/rooms/:room_id/tags</td>
</tr>
Expand Down
4 changes: 4 additions & 0 deletions migrations/001_prerelease/down.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ DROP TABLE room_memberships;
DROP TABLE rooms;
DROP TABLE users;
DROP TABLE room_tags;
DROP TABLE filters;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be related to #140?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so.

DROP TABLE presence_status;
DROP TABLE presence_list;
DROP TABLE presence_events;
14 changes: 14 additions & 0 deletions migrations/001_prerelease/up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,17 @@ CREATE TABLE filters (
content TEXT NOT NULL,
UNIQUE (id, user_id)
);

CREATE TABLE presence_status (
user_id TEXT PRIMARY KEY,
event_id TEXT NOT NULL,
presence TEXT NOT NULL,
status_msg TEXT,
updated_at TIMESTAMP NOT NULL DEFAULT now()
);

CREATE TABLE presence_list (
user_id TEXT NOT NULL,
observed_user_id TEXT NOT NULL,
PRIMARY KEY (user_id, observed_user_id)
);
2 changes: 2 additions & 0 deletions src/api/r0/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pub use self::join::{InviteToRoom, JoinRoom, JoinRoomWithIdOrAlias, LeaveRoom};
pub use self::login::Login;
pub use self::logout::Logout;
pub use self::members::Members;
pub use self::presence::{GetPresenceList, GetPresenceStatus, PostPresenceList, PutPresenceStatus};
pub use self::profile::{Profile, GetAvatarUrl, PutAvatarUrl, GetDisplayName, PutDisplayName};
pub use self::registration::Register;
pub use self::room_creation::CreateRoom;
Expand All @@ -28,6 +29,7 @@ mod join;
mod login;
mod logout;
mod members;
mod presence;
mod profile;
mod registration;
mod room_creation;
Expand Down
Loading