Commit graph libervia-backend/frontends/src/primitivus/chat.py
Author SHA1 Message Date
Goffi
bb9e22c020 quick_frontend, primitivus (chat): renamed updated to update, using a dict as argument + fixed Primitivus group chat 2016-09-15 21:58:35 +02:00
Goffi
78750cb265 quich frontend, primivius (chat): better avatar handling:
- new getAvatar method in QuickApp which request vCard if avatar if needed and return default avatar is no avatar is found
    - frontends based on quick frontend can now specify if they handle avatar or not using AVATARS_HANDLER
    - when avatar is updated, occupant widget(s) and all message widget(s) of the concerned entity are updated
2016-09-09 23:54:33 +02:00
Goffi
56211b33c6 primitivus, quick frontend (chat): moved time text generation to QuickChat 2016-08-08 21:05:04 +02:00
Goffi
2d468f9e94 quick frontends, primitivus: messageState signal handling 2016-08-02 23:11:44 +02:00
Goffi
c0e4960c55 primitivus (chat): added :topic (and :subject and :title aliases) to change subject with a dialog (/!\ urwid SàText need to be updated) 2016-07-24 19:00:50 +02:00
Goffi
82a12186ea quick frontend, primitivus (chat, contact_list): fixed MUC private messages handling:
- occupants can be clicked again
    - QuickChat.Occupant now keep room jid and real jid if available
    - history messages are filtered correctly when requesting history for MUC room or private conversation
2016-07-24 18:07:45 +02:00
Goffi
9f853cd774 quick_frontend, primitivus (chat): fixed widget bad locking + don't send notification when locked 2016-07-24 17:59:24 +02:00
Goffi
57daef07a7 quick_frontend, primitivus (contact_list): improved and simplified handling of "special" entities:
- special_extras has been removed
    - specials handle all entities (bare + full) in a single set
2016-07-24 17:47:09 +02:00
Goffi
9647e90943 backend (memory), frontends: improved history filtering:
a "filters" dictionnary is now use to filter, it can have, for now, filtering on:
        - "body": filter only on the body (equivalent to former "search" parameter, but not case sensitive)
        - "search": fitler on body + source resource
        - "types": allowed types
        - "not_types": forbidden types

    primitivus now do searching using "search", i.e. source resource is now taken into account (and search is now case insensitive)
2016-07-18 00:52:02 +02:00
Goffi
2368e68c37 primitivus (chat): don't send notification for move messages 2016-07-17 17:59:14 +02:00
Goffi
8c9161bc87 primitivus: fixed notifications counter for simple messages in MUC rooms 2016-07-17 17:12:42 +02:00
Goffi
cc160e03d7 plugin XEP-0085, quick_frontends, primitivus: chat states are working again 2016-07-17 16:47:33 +02:00
Goffi
0a197cab88 quick_frontend, primitivus: moved main_message property to quick_frontend 2016-07-10 12:26:13 +02:00
Goffi
bd46cb609e primitivus (chat): fixed a crash when page-up was pressed on room contacts list 2016-07-01 00:00:12 +02:00
Goffi
6b75a82f04 primitivus (chat): moved occupants widget to a dedicated class + display occupants count in footer 2016-07-01 00:00:11 +02:00
Goffi
a16d8bfc01 primitivus (chat): mention is now visible by date in red instead of body (or a "[*]" if date is hidden) 2016-06-28 18:31:08 +02:00
Goffi
2e204f182a primitivus (chat): fixed timestamp/nick (un)hiding + new redraw and printMessages methods 2016-06-28 18:29:56 +02:00
Goffi
aace5a2520 quick_frontend, primitivus (chat): mention detection in group chat + notification (mention and messages) 2016-06-27 22:37:51 +02:00
Goffi
22d70f23c4 primitivus (chat): fixed nick completion. Completion is now managed per widget, if completion method exists 2016-06-27 21:45:13 +02:00
Goffi
04515e5013 plugin XEP-0045, quick_frontend + primitivus (chat): cleaning of XEP-0045 (first pass):
- bridge methods/signals now all start with "muc" to follow new convention
    - internal method use client instead of profile to follow new convention
    - removed excetpions from plugin XEP-0045 in favor of core.exceptions, NotReady added
    - cleaned/simplified several part of the code. checkClient removed as it is not needed anymore
    - self.clients map removed, muc data are now stored directly in client
    - getRoomEntityNick and getRoomNicksOfUsers are removed as they don't look sane.
        /!\ This break all room game plugins for the moment
    - use of uuid4 instead of uuid1 for getUniqueName, as host ID and current time are used for uuid1
2016-06-27 21:45:11 +02:00
Goffi
be443a043f primitivus (chat): fixed filters clearing when changing filter while one already exists 2016-06-20 23:07:53 +02:00
Goffi
e784c1694c primitivus: basic handling of filter, only language can filtered for now 2016-06-20 19:19:16 +02:00
Goffi
a7de473107 backend, frontends: message refactoring (huge commit):
/!\ several features are temporarily disabled, like notifications in frontends

next step in refactoring, with the following changes:
    - jp: updated jp message to follow changes in backend/bridge
    - jp: added --lang, --subject, --subject_lang, and --type options to jp message + fixed unicode handling for jid
    - quick_frontend (QuickApp, QuickChat):
        - follow backend changes
        - refactored chat, message are now handled in OrderedDict and uid are kept so they can be updated
        - Message and Occupant classes handle metadata, so frontend just have to display them
    - Primitivus (Chat):
        - follow backend/QuickFrontend changes
        - info & standard messages are handled in the same MessageWidget class
        - improved/simplified handling of messages, removed update() method
        - user joined/left messages are merged when next to each other
        - a separator is shown when message is received while widget is out of focus, so user can quickly see the new messages
        - affiliation/role are shown (in a basic way for now) in occupants panel
        - removed "/me" messages handling, as it will be done by a backend plugin
        - message language is displayed when available (only one language per message for now)
        - fixed :history and :search commands
    - core (constants): new constants for messages type, XML namespace, entity type
    - core: *Message methods renamed to follow new code sytle (e.g. sendMessageToBridge => messageSendToBridge)
    - core (messages handling): fixed handling of language
    - core (messages handling): mes_data['from'] and ['to'] are now jid.JID
    - core (core.xmpp): reorganised message methods, added getNick() method to client.roster
    - plugin text commands: fixed plugin and adapted to new messages behaviour. client is now used in arguments instead of profile
    - plugins: added information for cancellation reason in CancelError calls
    - plugin XEP-0045: various improvments, but this plugin still need work:
        - trigger is used to avoid message already handled by the plugin to be handled a second time
        - changed the way to handle history, the last message from DB is checked and we request only messages since this one, in seconds (thanks Poezio folks :))
        - subject reception is waited before sending the roomJoined signal, this way we are sure that everything including history is ready
        - cmd_* method now follow the new convention with client instead of profile
        - roomUserJoined and roomUserLeft messages are removed, the events are now handled with info message with a "ROOM_USER_JOINED" info subtype
    - probably other forgotten stuffs :p
2016-06-20 18:41:53 +02:00
Goffi
f12803fa65 backend, frontend: messages refactoring (huge commit, not finished):
/!\ database schema has been modified, do a backup before updating

    message have been refactored, here are the main changes:

    - languages are now handled
    - all messages have an uid (internal to SàT)
    - message updating is anticipated
    - subject is now first class
    - new naming scheme is used newMessage => messageNew, getHistory => historyGet, sendMessage => messageSend
    - minimal compatibility refactoring in quick_frontend/Primitivus, better refactoring should follow
    - threads handling
    - delayed messages are saved into history
    - info messages may also be saved in history (e.g. to keep track of people joining/leaving a room)
    - duplicate messages should be avoided
    - historyGet return messages in right order, no need to sort again
    - plugins have been updated to follow new features, some of them need to be reworked (e.g. OTR)
    - XEP-0203 (Delayed Delivery) is now fully handled in core, the plugin just handle disco and creation of a delay element
    - /!\ jp and Libervia are currently broken, as some features of Primitivus

    It has been put in one huge commit to avoid breaking messaging between changes.
    This is the main part of message refactoring, other commits will follow to take profit of the new features/behaviour.
2016-05-24 22:11:04 +02:00
Goffi
6bbcbaf522 use of /usr/bin/env instead of /usr/bin/python in shebang 2016-04-17 14:45:26 +02:00
souliane
923dcc593d primitivus (chat): since dialog refresh is done in message notification, print the message first and then notify 2016-01-13 08:50:40 +01:00
souliane
a08a073503 quick_frontend, primitivus (chat): move notification command to quick_frontend 2016-01-12 17:52:17 +01:00
Goffi
348be27934 copyright update 2016-01-03 16:28:30 +01:00
souliane
f153fd885d quick_frontend, primitivus (chat): printing the history is left to quick_frontend 2015-12-22 11:39:45 +01:00
souliane
8aec15cecf primitivus (chat): duplicate message check is actually not needed when retrieving local MUC history is disabled 2015-12-16 13:29:24 +01:00
souliane
77c0656c85 frontends: small message refactorisation:
- factorize some treatments that were done both in Primitivus and Libervia
    - the way it was done, especially with QuickChat.printMessage returning a tuple, was quite disturbing
    - FIXME: we can probably remove some arguments and do a deeper factorization e.g with QuickChatText
2015-12-12 12:18:54 +01:00
Goffi
435a3fcb90 primivitus: fixed crash when self.target is a full jid 2015-11-20 11:46:26 +01:00
Goffi
fc9b4fb02c primitivus: removed all file menu + temporary workaround to send full jid on C.MENU_SINGLE menu action. 2015-11-20 01:57:18 +01:00
Goffi
73139e59ba Primitivus: better popups handling:
- widget to remove can now be specified in removePopUp: if it is not the current one, it will be removed from queue
    - Primitivus.Alert method is a shortcut to display an Alert which will be removed on "OK" press
    - showDialog is now obsolete and removed, if generic dialog creation is needed, XMLUI can be used
2015-11-11 18:32:59 +01:00
souliane
2203e6aa52 quick_frontend, primitivus: fixes a couple of issues:
- chat: notification was raising an error when you just entered the room and self.nick is None
    - quick_widget: deleting a widget was modifying a dict while looping on it + unselect widget when it's being deleted
2015-04-16 17:17:28 +02:00
Goffi
fbec02d396 2015 copyright dates update 2015-03-30 10:26:26 +02:00
souliane
ff0166e95f quick_frontend, primitivus: various fixes (MUC and cached signals):
- actually call the cached signals, everything was there but the call was not done
    - display '[]' instead of '[None]' when group message coming from the room (no resource)
    - catch the exception when trying to delete an occupant who's not in the room
    - do not cache a "main resource" for MUC entities
2015-03-25 15:25:51 +01:00
souliane
30f1169e22 primitivus (Chat): fixes updating the occupant list when someone leaves, changes his nick or is added in last position 2015-03-25 10:09:59 +01:00
souliane
e81c92c549 quick_frontend, primivitus: revert changes made in rev 1386 (1f3513cfb246) concerning ChatText.nick: was mixing MUC occupant nick and roster contact nick/node 2015-03-25 09:42:05 +01:00
souliane
78f14091b1 quick_frontend, primitivus: remove QuickChat.updateEntityState and QuickChat.setContactStates, use more general QuickChat.update (also called when joining the room to initialise the occupants list) 2015-03-24 17:31:08 +01:00
souliane
5c1fe63580 quick_frontend, primivitus: remove QuickChat.getUserNick + primivitus ChatText gets the user nick directly from parent Chat instance 2015-03-23 15:38:32 +01:00
souliane
83af62d142 quick_frontend, primitivus (chat): merge setOccupantStates and setContactStates 2015-03-23 09:34:23 +01:00
souliane
6dc8b211bf quick_frontend, primitivus: better PEP-8 compliance + remove/rename some (Quick)Chat attributes:
- remove QuickChat.id, use QuickChat.target instead
    - rename Chat.present_panel to Chat.occupants_panel
    - rename Chat.present_wid to Chat.occupants_list
2015-03-22 14:20:19 +01:00
souliane
14f4b4b8ec quick_frontends, primitivus: move the chat states logic to quick_frontend 2015-03-20 16:28:19 +01:00
souliane
c6419871ac quick_frontends, primitivus: know who are the MUC occupants from the presence informations:
- QuickChat.occupants is now a property using cached information
    - some MUC handlers are no more needed, the presence handler is enough
2015-03-20 16:25:38 +01:00
souliane
b76d829249 quick_frontend, primitivus (chat): pass a sorted list to Chat.setPresents 2015-03-11 20:06:13 +01:00
souliane
e597a804d9 frontends (quick_frontend, primitivus): fixes room games:
- add quick_frontend.quick_games for registering the signals and registering the UI classes
    - rename the signals handlers to fit the convention (e.g.: tarotGameScoreHandler)
    - rename card_game to game_tarot, quick_card_game to quick_game_tarot, CardGame to TarotGame
2015-03-11 12:43:48 +01:00
Goffi
8ce5c1862b core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
/!\ not finished, everything is still instable !
    - bridge: DBus bridge has been modified to allow blocking call to be called in the same way as asynchronous calls
    - bridge: calls with a callback and no errback are now possible, default errback log the error
    - constants: removed hack to manage presence without OrderedDict, as an OrderedDict like class has been implemented in Libervia
    - core: getLastResource has been removed and replaced by getMainResource (there is a global better management of resources)
    - various style improvments: use of constants when possible, fixed variable overlaps, import of module instead of direct class import
    - frontends: printInfo and printMessage methods in (Quick)Chat are more generic (use of extra instead of timestamp)
    - frontends: bridge creation and option parsing (command line arguments) are now specified by the frontend in QuickApp __init__
    - frontends: ProfileManager manage a more complete plug sequence (some stuff formerly manage in contact_list have moved to ProfileManager)
    - quick_frontend (quick_widgets): QuickWidgetsManager is now iterable (all widgets are then returned), or can return an iterator on a specific class (return all widgets of this class) with getWidgets
    - frontends: tools.jid can now be used in Pyjamas, with some care
    - frontends (XMLUI): profile is now managed
    - core (memory): big improvment on entities cache management (and specially resource management)
    - core (params/exceptions): added PermissionError
    - various fixes and improvments, check diff for more details
2015-01-24 01:00:29 +01:00
Goffi
e4708c9cbb quick_frontend, primitivus: multi-profiles refactoring part 1 (big commit, sorry :p):
This refactoring allow primitivus to manage correctly several profiles at once, with various other improvments:
    - profile_manager can now plug several profiles at once, requesting password when needed. No more profile plug specific method is used anymore in backend, instead a "validated" key is used in actions
    - Primitivus widget are now based on a common "PrimitivusWidget" classe which mainly manage the decoration so far
    - all widgets are treated in the same way (contactList, Chat, Progress, etc), no more chat_wins specific behaviour
    - widgets are created in a dedicated manager, with facilities to react on new widget creation or other events
    - quick_frontend introduce a new QuickWidget class, which aims to be as generic and flexible as possible. It can manage several targets (jids or something else), and several profiles
    - each widget class return a Hash according to its target. For example if given a target jid and a profile, a widget class return a hash like (target.bare, profile), the same widget will be used for all resources of the same jid
    - better management of CHAT_GROUP mode for Chat widgets
    - some code moved from Primitivus to QuickFrontend, the final goal is to have most non backend code in QuickFrontend, and just graphic code in subclasses
    - no more (un)escapePrivate/PRIVATE_PREFIX
    - contactList improved a lot: entities not in roster and special entities (private MUC conversations) are better managed
    - resources can be displayed in Primitivus, and their status messages
    - profiles are managed in QuickFrontend with dedicated managers


This is work in progress, other frontends are broken. Urwid SàText need to be updated. Most of features of Primitivus should work as before (or in a better way ;))
2014-12-10 19:00:09 +01:00
souliane
7a344fcf5d frontends: printInfo and printMessage timestamp attribute defaults to None instead of '' 2014-10-04 10:23:13 +02:00