Commit Graph

23 Commits

Author SHA1 Message Date
miruka
dc2f779d4b Make login button work for login page 2019-04-26 18:47:25 -04:00
miruka
5988eccdbb Add login page and forget room system 2019-04-26 16:02:20 -04:00
miruka
99d5fb551c Make the banner buttons work
For invitation accept/decline.
Forget remains to be implemented in nio.
2019-04-21 16:12:53 -04:00
miruka
ea8f75c729 Organize banners, add LeftBanner
Previously there was InviteOffer, now there's a base Banner component,
InviteBanner and LeftBanner.
2019-04-21 15:20:20 -04:00
miruka
9602608b87 Add inviter account informations to room invites 2019-04-21 11:15:03 -04:00
miruka
2c5dc7bd4f Handle room invites
Add them to the roomList, and have separate sections:
Invites and Rooms.
2019-04-21 06:56:59 -04:00
miruka
8f35e60801 Capitalization, list model and room header work
- Standardized capitalization for variables and file names everywhere in
  QML and JS, get rid of mixed camelCase/snakeCase,
  use camelCase like everywhere in Qt

- ListModel items are now stored and returned as real QObjects with
  PyQt properties and signals.
  This makes dynamic property binding a lot easier and eliminates the need
  for many hacks.

- New update(), updateOrAppendWhere() methods and roles property
  for ListModel

- RoomHeader now properly updates when the room title or topic changes

- Add Backend.pdb(), to make it easier to start the debugger from QML
2019-04-20 17:43:57 -04:00
miruka
99c06e4034 Fix local echoes not sent if all threads occupied 2019-04-19 18:37:56 -04:00
miruka
aa55ffbc6a Prevent queuing lots of setTypingState
@futurize() is now called with parentheses and can take a max_instances
int argument. This is used for setTypingState to not have more than one
queued calls per room and True/False state and avoids bombing the server
with old ephemeral events after a network loss and reconnection.
2019-04-19 18:21:19 -04:00
miruka
188dc6be98 Socket timeouts, always HTTP reconnect on errors 2019-04-19 17:17:37 -04:00
miruka
0d7728665f Handle network errors
- Move HTTP connect/disconnect logic to networkManager
- If a talk fails due to socket error, HTTP transport error or
  nio bad response that might change, retry every 2s until success
- Clean up some leftover debug prints
2019-04-19 16:15:21 -04:00
miruka
9a1b91caa5 Set user typing state when using the SendBox 2019-04-19 03:11:56 -04:00
miruka
1d0cce402e Proper display name retrieval implementation
For any name not found in rooms data, rely on new
nio.HttpClient.get_displayname() function to get and cache it,
e.g. for our own name if no room is joined and past events from users
who left the room.

@futurize now returns PyQtFuture objects, wrapper for the
concurrent.futures.Future objects that can be used from QML,
to ensure name retrieval does not block the GUI.
2019-04-19 02:26:29 -04:00
miruka
11d900965a Add local echoing of messages
As per
https://matrix.org/docs/spec/client_server/latest.html#local-echo
2019-04-18 13:46:39 -04:00
miruka
98b494fcc2 Convert markdown to HTML for sendbox
Also pass to clientManager the Backend, and to Client the clientManager,
and set Qt parents for them.
2019-04-17 23:28:25 -04:00
miruka
a7649d1a7a Make the SendBox work, send plaintext messages 2019-04-17 23:01:26 -04:00
miruka
6ab4acdc84 Improve room past events loading
- Trigger when room is shown if there's not enough messages to fill the
  list height

- Trigger whenever user is scrolling before a certain point, instead of
  when dragging is released/scrolling stopped and the top edge is hit

- Prevent multiple load requests at same time

- Keep a set of fully loaded rooms, don't request anymore history
  if a room is fully loaded
2019-04-17 22:34:22 -04:00
miruka
a0f9acddaa Load past events when scrolling up
Also keep two nio clients internally: one for loop-syncing, one for the
rest; since they can't handle more than one talk at a time.
2019-04-17 21:08:32 -04:00
miruka
8a3189df15 Add users currently typing in room bar 2019-04-14 16:12:07 -04:00
miruka
9c66166c4f Display room messages and other events 2019-04-14 12:56:30 -04:00
miruka
13fca98838 Rooms and threads fixes
- Fix roomList height again, now based on model.count().
  All delegates are assumed to be the same height

- Properly update room list when a room is joined or left

- Catch exceptions happening in threads (futures), which previously
  passed silently

- Show "Empty room?" as "<i>Empty Room</i>" + gray [?] avatar
2019-04-13 08:59:10 -04:00
miruka
30514fb7db Show joined rooms, delete left rooms
To make the models update correctly in QML:
- ListModel and _QtModel merged
- Return a ListModelMap QObject from properties instead of
  a DefaultDict → QVariantMap
2019-04-12 13:18:46 -04:00
miruka
5d4c7b8520 Reorganize backend files, show accounts in UI 2019-04-12 04:33:09 -04:00