Commit graph libervia-backend/frontends/src/quick_frontend/quick_chat.py
Author SHA1 Message Date
Goffi
f5f25e8ab5 misc: date update (yes it's a bit late :p ) 2017-11-03 14:31:42 +01:00
Goffi
9b0542fb46 core, frontends: various fixes for Libervia:
- quick_app: don't fail when we can't get autodisconnect parameter
    - bridge: removed useless BridgeFrontend parent class
    - use of TypeError, unicode and list to workaround Pyjamas incompatibilities
2017-02-26 18:23:01 +01:00
Goffi
4eaf5d626f plugin XEP-0054, quick frontend(app): various improvments:
- memory.cache is now used
    - getAvatar and setAvatar has been renamed to avatarGet and avatarSet to follow new convention
    - getAvatar now return (optionally) full path, and may request vCard or only return avatar in cache
    - getAvatarFile has been removed as it is not needed anymore (avatarGet can return full path)
    - getCard has been removed from bridge as it was only used to request avatar
    - new internal method getBareOfFull return jid to use depending of the jid being part of a MUC or not
    - cache is now set per profile in client, instead of a general one for all profiles
    - thanks to the use of memory.cache, correct extension is now used in saved file, according to MIME type
    - fixed and better cache handling
    - a warning message is shown if given avatar hash differs from computed one
    - empty hash value is now in a constant, and ignored if received
    - QuickApp has been updated to follow new behaviour
    - Primitivus has been fixed (it was not declaring not using avatars correclty)
    - jp has been updated to follow new methods name
2017-01-15 17:51:37 +01:00
Goffi
42f5bb6192 quick frontends (chat): send actual value instead of None on status and state updates 2017-01-09 23:10:16 +01:00
Goffi
2618d48e7b core, quick_frontends: android compatibility hacks:
a couple of hacks have been used so backend can be launched on android using kivy
    - config file (sat.conf) is been read on a specific dir, using a detection of Cagou domains in constants.py
    - fixed crash when using sys.stdout.isatty in log_config.py
    - Q&D fix for logging encoding issue on android
    - when android is detected, the path/pattern to load plugins is modified
    - SRV is not working at the moment on android. If the platform is detected, the host is used directly with default port. A hosts_dir configuration can be used in [android] section to map a specific ip to a host
    - getRepositoryData in tools/utils return constant string on android. Proper repository data need to be copied during package building.
    - [quick app] more robust failure handling on asyncConnect error
    - [quick chat] default to utf-8 when getlocale doesn't return the actual locale.
2016-12-04 18:16:48 +01:00
Goffi
63b1c9af14 quick frontend (chat): added Message.main_message_xhtml property to get XHTML content 2016-09-25 16:07:44 +02:00
Goffi
320139c34e quick frontend (chat): update use a dict 2016-09-23 22:50:13 +02:00
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
42167b6ae9 plugin XEP-0045, quick frontend (app,chat): various chat improvments:
- (XEP-0045): join defered is now fired when room is full joined and history is available
    - (XEP-0045): mucJOIN signature has changed, it now returns the same arguments as mucRoomJoined and a boolean which is True if the room was alread joined
    - quick frontend (app, chat): adapted code to new changes
2016-09-09 23:54:33 +02:00
Goffi
48871f96cc quick frontend (chat): recreateArgs implementation 2016-09-09 23:54:33 +02:00
Goffi
619f892de0 quick frontend (chat): added helping properties avatar and contact_list 2016-08-29 01:21:47 +02:00
Goffi
eb1dd1d177 plugin XEP-0245: removed plugin XEP-0245:
at the end it adds complications to handle XEP-0245 in backend (because edge cases must be handled: info type with group chat, history when message is info but for a group chat, etc) while it's trivial to handle it in frontend.
    So /me detection is handled in QuickFrontend and cmd_me is back into plugin_misc_text_commands, it is the choice of the frontend to display or not the "/me" (for frontends based on QuickFrontend it remains automatic).
2016-08-28 21:00:53 +02:00
Goffi
dcab42b1d7 quick_frontend (chat): fixed hash generation, tuple was causing trouble when used with unicode() because of dbus.String 2016-08-28 19:42:48 +02:00
Goffi
ddcb938332 quick frontend (chat): fixed getWidgetHash 2016-08-28 18:23:55 +02:00
Goffi
caaa753d80 quick frontend (chat): fixed messageNew signal dispatching when several widgets are handling the target 2016-08-21 17:04:33 +02:00
Goffi
cc17c2869f quick frontend (chat): added a getlocale method and changed self.day_change calculation for pyjamas compatibility 2016-08-09 01:11:22 +02:00
Goffi
56211b33c6 primitivus, quick frontend (chat): moved time text generation to QuickChat 2016-08-08 21:05:04 +02:00
Goffi
c7e84506dd quick frontend(chat): fixed traceback in log message 2016-08-08 00:48:22 +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
60c8f2fc3d quick_frontend(chat): better handling of cached signals when initialising widget 2016-07-24 18:02:34 +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
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
aace5a2520 quick_frontend, primitivus (chat): mention detection in group chat + notification (mention and messages) 2016-06-27 22:37:51 +02:00
Goffi
b388d2b172 quick_frontend, primitivus: notifications refactoring
replaced old "alerts" system by a more generic one which use listeners and can activate callbacks on notification click.
2016-06-27 22:36:22 +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
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
2a99e4bc38 quick_frontend (chat): temporary fix for bug 12:
- avoid duplicate one2one message (before the history + as a part of it)
    - do not display "=> <nick> has joined the room" for each occupant when we have just joined a MUC
2015-12-22 11:44:51 +01:00
souliane
87bd260149 quick_frontend (chat): scroll down after having printed the history 2015-12-22 11:43:02 +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
99785755e1 quick_frontend: restore printing the day change while displaying history 2015-12-15 20:05:27 +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
1170edc400 quick_frontend: minor fixes 2015-08-16 01:01:34 +02:00
souliane
042e19b812 quick_frontend (quick_chat): QuickChat._get_nick returns "" instead of None for message from the MUC 2015-07-14 16:49:29 +02:00
souliane
f978524b22 display the resource in the chat dialog when printing a private MUC message 2015-04-24 16:10:46 +02:00
Goffi
fbec02d396 2015 copyright dates update 2015-03-30 10:26:26 +02: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
d24eb9976d quick_frontend: display MUC games symbols 2015-03-20 16:29:03 +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