From goffi at goffi.org Thu Nov 7 16:08:52 2013 From: goffi at goffi.org (Goffi) Date: Thu, 07 Nov 2013 16:08:52 +0100 Subject: [dev] [EN] Rich text implementation Message-ID: <568f14642e244b095b8cefb064b9e2f7@mail.goffi.org> G'day all sorry for this message in english only... I have commited backend part for managing rich syntaxes, here are some comments: - first of all, database has changed, you need to manually update it. Open the database (usually "sqlite3 ~/.sat/sat.db" should do it) and enter "ALTER TABLE history ADD COLUMN extra BLOB;". I guess that we will need an automatic update tool soon, specialy now that SàT enterred several major GNU/Linux distributions - parameters are now updated in case of an already existing parameter name, so I renamed memory.importParam to memory.updateParams - the extra data dictionary is now saved in database, and sent with getHistory return value. Frontends have been updated. - as I had to managed deferred with newMessage trigger, I have added a post_treat argument to the trigger: plugins can add callbacks to this deferred to add treatments (this is done here to add rich syntax to the extra data). - I have added lxml as a dependency now comments about the rich syntax: - syntaxes are managed by misc_text_syntaxes plugin - I have choosed XHTML (utf-8) as main language. To add a syntax, you need two methods: one for new_syntax => XHTML, and one for XHTML => new_syntax. This allow to reuse easily the tons of text conversion tools, and to easily convert from one language to another. - when you add a syntax, by default the conversion methods are threaded so you can easily use blocking code, but this can be deactivated with OPT_NO_THREAD flag. - an added syntax is automatically added to the Composition/Syntax parameter, except if the OPT_HIDDEN flag is set. - a convert method allow to convert from any managed syntax to any other one, by default the resulting code is cleaned to avoid anything malicious, this can be deactivated with the safe attribute. - so far, the cleaning is done using lxml's cleaning method, but the *styles are not cleaned yet*, this can be potentially dangerous. So I'm waiting to clean styles before updating online Libervia demo. - when rich text is present, it's always put in a "xhtml" key in the extra data dictionary, so the frontends only have to manage XHTML, which is most of time already done in graphical toolkits. It can anyway use the convert bridge method if it want to use another syntax. - external images are included in the XHTML, which can lead to pricavy concerns (downloading external image can show the online presence or proove that a message has been opened). It's the role of the frontend to not display the external file except if user explicitly ask for it. I'm planing to add a parameter to manage this. This is actually true for all external files, not only images (but normally, no other external files will appear in the resulting XHTML) - so far, only Libervia show rich text, and only for instant messaging. It will change soon :) Cheers Goffi From souliane at mailoo.org Fri Nov 8 20:35:26 2013 From: souliane at mailoo.org (Adrien) Date: Fri, 08 Nov 2013 20:35:26 +0100 Subject: [dev] [EN] Rich text implementation In-Reply-To: <568f14642e244b095b8cefb064b9e2f7@mail.goffi.org> References: <568f14642e244b095b8cefb064b9e2f7@mail.goffi.org> Message-ID: <527D3CFE.8080908@mailoo.org> Hi, great! On 11/07/2013 04:08 PM, Goffi wrote: > - I have added lxml as a dependency A warning is displayed when a python module for a richtext syntax is missing. I guess this is enough and you didn't add these modules as a dependency on purpose, because it is a plugin and not mandatory, right? As I'm not sure I prefer to point it out and ask for a confirmation. > - an added syntax is automatically added to the Composition/Syntax > parameter, except if the OPT_HIDDEN flag is set. Terrific :) > - so far, only Libervia show rich text, and only for instant messaging. > It will change soon :) Libervia still displays the "raw" message to me (not on libervia.org but on my dev version after pulling changes for sat and libervia). It looks like the changes to display rich text messages are here, but not those to actually put rich text content while sending a message... did I miss somethng?! Best regards, Adrien From goffi at goffi.org Fri Nov 8 22:31:08 2013 From: goffi at goffi.org (Goffi) Date: Fri, 08 Nov 2013 22:31:08 +0100 Subject: [dev] [EN] Rich text implementation In-Reply-To: <527D3CFE.8080908@mailoo.org> References: <568f14642e244b095b8cefb064b9e2f7@mail.goffi.org> <527D3CFE.8080908@mailoo.org> Message-ID: <527D581C.8040705@goffi.org> On 08/11/2013 20:35, Adrien wrote: > Hi, > > great! > > On 11/07/2013 04:08 PM, Goffi wrote: >> - I have added lxml as a dependency > > A warning is displayed when a python module for a richtext syntax is > missing. I guess this is enough and you didn't add these modules as a > dependency on purpose, because it is a plugin and not mandatory, right? > As I'm not sure I prefer to point it out and ask for a confirmation. Yes it's on purpose: the warning is about markdown. If python-markdown and python-html2txt are installed, markdown is activated and is the default syntax in SàT, else it's not and XHTML is the default syntax. I guess we should manage a way to recommand external libraries or plugins. > Libervia still displays the "raw" message to me (not on libervia.org but > on my dev version after pulling changes for sat and libervia). It looks > like the changes to display rich text messages are here, but not those > to actually put rich text content while sending a message... did I miss > somethng?! Only instant messages sent to Libervia are displayed. You can try with Gajim for example: the style bouton should be activated, and you can try to make a test bold or add color. I'm working now on using it in the other direction (Allowing Libervia to send rich text), and after I will add it to microbloging. From souliane at mailoo.org Sat Nov 9 17:48:41 2013 From: souliane at mailoo.org (Adrien) Date: Sat, 09 Nov 2013 17:48:41 +0100 Subject: [dev] [PATCH][en] Room games and other stuff Message-ID: <527E6769.1030409@mailoo.org> Hi, please find some patches attached. Here a quick description of the changes: sat_media/wix: - new crystal icons sets generated from the 128x128 one, wix now use the 32x32 icon to workaround some issue I have with mate desktop notification area. That size should be big enough for all anyway. sat: - cleaned the part to load/save xml. When jp will be patched to use argparse I will add the options to do it from jp. - factorization, fixes and a couple of improvements for the room games, including a new parameter for the user to decide what to do when he got invited to a room: always/never join or ask him. Also display in primitivus the "choose contrat" dialog with valign="top" to allow the user see his hand while he's thinking about his contrat. - fixed getHistory behavior when parameter between=True: the previous behavior returns the messages between X and Y, but also the messages between X and X. Goffi> please double check to ensure no regression - some methods and definition data moved to sat/tools/... - attribute "short" renamed to "bare" in class tools.jid.JID libervia: - it is possible to auto-connect via specifying URL parameters. This is useful for debugging, not having to retype your connection information after each restart of Libervia's server. - code from the recipients selection in the rich text dialog is re-used for a new "manage contact group" dialog (menu item in the "Contacts" menu bar. You can add and remove contacts from a group, add or delete a group (via left click / popup menu: to be improved as it's not very intuitive) - open the web widget in the current tab, not in a new one There are a couple of known issues with the AutoComplexTextBoxes and drap-and-dropping elements, I could not fix them yet but it's not that serious. Also there's a display issue if you remove the first group from the contact group manager dialog. Please let me know about any other problems you would encounter. If these patches are OK, I will do next some improvements for the collective radio and general MUC invitations + add the status bar (ready for chat, dnd, away...) in libervia and primitivus (it is already in wix). Best regards, Adrien -------------- section suivante -------------- Une pièce jointe autre que texte a été nettoyée... Nom: crystal_icons.patch Type: text/x-diff Taille: 50476 octets Desc: non disponible URL: -------------- section suivante -------------- Une pièce jointe autre que texte a été nettoyée... Nom: libervia.patch Type: text/x-diff Taille: 78172 octets Desc: non disponible URL: -------------- section suivante -------------- Une pièce jointe autre que texte a été nettoyée... Nom: sat.patch Type: text/x-diff Taille: 142709 octets Desc: non disponible URL: -------------- section suivante -------------- Une pièce jointe autre que texte a été nettoyée... Nom: social_contract_typos.patch Type: text/x-diff Taille: 3821 octets Desc: non disponible URL: From goffi at goffi.org Mon Nov 11 12:34:32 2013 From: goffi at goffi.org (Goffi) Date: Mon, 11 Nov 2013 12:34:32 +0100 Subject: [dev] [PATCH][en] Room games and other stuff In-Reply-To: <527E6769.1030409@mailoo.org> References: <527E6769.1030409@mailoo.org> Message-ID: <28472da33aae2b1a39dfc7a52041121f@mail.goffi.org> applied, thx Le 2013-11-09 17:48, Adrien a écrit : > Hi, > > please find some patches attached. Here a quick description of the > changes: > > sat_media/wix: > - new crystal icons sets generated from the 128x128 one, wix now use > the 32x32 icon to workaround some issue I have with mate desktop > notification area. That size should be big enough for all anyway. > > sat: > - cleaned the part to load/save xml. When jp will be patched to use > argparse I will add the options to do it from jp. > - factorization, fixes and a couple of improvements for the room > games, including a new parameter for the user to decide what to do > when he got invited to a room: always/never join or ask him. Also > display in primitivus the "choose contrat" dialog with valign="top" > to > allow the user see his hand while he's thinking about his contrat. > - fixed getHistory behavior when parameter between=True: the previous > behavior returns the messages between X and Y, but also the messages > between X and X. Goffi> please double check to ensure no regression > - some methods and definition data moved to sat/tools/... > - attribute "short" renamed to "bare" in class tools.jid.JID > > libervia: > - it is possible to auto-connect via specifying URL parameters. This > is useful for debugging, not having to retype your connection > information after each restart of Libervia's server. > - code from the recipients selection in the rich text dialog is > re-used for a new "manage contact group" dialog (menu item in the > "Contacts" menu bar. You can add and remove contacts from a group, > add > or delete a group (via left click / popup menu: to be improved as > it's > not very intuitive) > - open the web widget in the current tab, not in a new one > > There are a couple of known issues with the AutoComplexTextBoxes and > drap-and-dropping elements, I could not fix them yet but it's not > that > serious. Also there's a display issue if you remove the first group > from the contact group manager dialog. Please let me know about any > other problems you would encounter. > > If these patches are OK, I will do next some improvements for the > collective radio and general MUC invitations + add the status bar > (ready for chat, dnd, away...) in libervia and primitivus (it is > already in wix). > > > Best regards, > Adrien From goffi at goffi.org Wed Nov 13 14:14:51 2013 From: goffi at goffi.org (Goffi) Date: Wed, 13 Nov 2013 14:14:51 +0100 Subject: [dev] [en] rich text in sendMessage Message-ID: <52837B4B.7010706@goffi.org> G'day, I have added the handling of sendMessage in XEP-0071 plugin, so it's now possible to send rich chat text, throught it's not yet managed in frontends. To send a rich text, the "extra" (formely "options") dictionary of sendMessage must have a "rich" element with the rich text in the currently selected syntax. sendMessage now use a deferred which can be used by plugins to modify the behaviour. sendMessageXml trigger has been removed as it is now obsolete. I have also changed the history management: if "message" data (i.e.: text only version of the message) is empty, the message is not saved to database. It's avoir the storage of empty messages (that was happening with the chat state plugin). ++ Goffi From kedals0 at gmail.com Sun Nov 17 11:36:38 2013 From: kedals0 at gmail.com (kedals0 at gmail.com) Date: Sun, 17 Nov 2013 11:36:38 +0100 Subject: [dev] [draft] Proposal for jp subcommands Message-ID: <871u2fs4ax.fsf@lenovo.home> Hi, I'm implementing subcommand for jp client. In the attached archive, you can find a first draft of this proposal. Each features (or group of features, bring by a plugin for instance) are specified in a module which is imported by jp. The objective is to dynamically enable a subcommand (or group of subcommands) if the bridge offers required methods. this is currently not implemented but it will be easy to check this on subcommand module loading. In attachment, you will find: - main.py : load jp subcommand modules - base.py : base classes to write module - message.py : to send message (this works for me) - profile.py : to manage profile (this works for me) - file.py : to send files to contact (doesn't work for me). Moreover, I have to add recv subcommands. To see subcommands structure: $ python main.py --help About the profile that jp has to used, I propose to use an environnment variable such as SAT_PROFILE (not implemented yet). Moreover, when a command needs a profile, a '-p' argument can be specified which overloads the environnment variable. As you will see, the code is not really clean (ok, really dirty!). But I can't take time to clean it without your approval. So I'm waiting for your opinion. + Dal. -------------- section suivante -------------- Une pièce jointe autre que texte a été nettoyée... Nom: jp_subcommands.tgz Type: application/x-gtar-compressed Taille: 4956 octets Desc: non disponible URL: From goffi at goffi.org Mon Nov 18 14:35:28 2013 From: goffi at goffi.org (Goffi) Date: Mon, 18 Nov 2013 14:35:28 +0100 Subject: [dev] [draft] Proposal for jp subcommands In-Reply-To: <871u2fs4ax.fsf@lenovo.home> References: <871u2fs4ax.fsf@lenovo.home> Message-ID: <528A17A0.3070909@goffi.org> On 17/11/2013 11:36, kedals0 at gmail.com wrote: > Hi, Hi > > I'm implementing subcommand for jp client. In the attached archive, you > can find a first draft of this proposal. It look great, thanks for your work :) > > Each features (or group of features, bring by a plugin for instance) are > specified in a module which is imported by jp. The objective is to > dynamically enable a subcommand (or group of subcommands) if the bridge > offers required methods. this is currently not implemented but it will > be easy to check this on subcommand module loading. plugin detection is planned this week. We were supposed to release the 0.4 today, but I guess we'll need an other week. > In attachment, you will find: > - main.py : load jp subcommand modules > - base.py : base classes to write module > - message.py : to send message (this works for me) > - profile.py : to manage profile (this works for me) > - file.py : to send files to contact (doesn't work for me). Moreover, I > have to add recv subcommands. That seem a sane split for me. > > To see subcommands structure: > $ python main.py --help I have tried, but profile-delete, profile-info, profile-list seems too much positional arguments for the same category. I think it would make more sense to have profile delete, profile info, etc. Same thing for file. Also, main.py should be renamed jp. > > About the profile that jp has to used, I propose to use an environnment > variable such as SAT_PROFILE (not implemented yet). Moreover, when a > command needs a profile, a '-p' argument can be specified which > overloads the environnment variable. No problem with that. Note that there is a default value, which is "@DEFAULT@" and use the profile declared as default in the backend. If there is in addition na environment variable, I'm bit worrying about the confusion, but that's not such a big deal. > As you will see, the code is not really clean (ok, really dirty!). But I > can't take time to clean it without your approval. Anyway it's still better that the original jp one: it was just a simple script quickly done; but now we can start to use it as a real swiss-knife for SàT (and more generally XMPP) :). Don't worry globally, we are improving the code quality progressively, so it's not a drama if it's not perfect at the first shot; > > So I'm waiting for your opinion. I'm ok for the way you are doing so far. If nobody else has suggestion, I think you can continue like this. Thanks again for your contribution :) > + > Dal. ++ Goffi P.-S.: you should also import argparse for python 2.6, as it is standard only since python 2.7, but there is a version compatible 2.6 on pipy. jp should be Python 2.6 compatible (2.5 is old enough to dismiss it). From souliane at mailoo.org Thu Nov 21 19:20:24 2013 From: souliane at mailoo.org (Adrien) Date: Thu, 21 Nov 2013 19:20:24 +0100 Subject: [dev] [PATCH][EN] room games and coe Message-ID: <528E4EE8.8010805@mailoo.org> Hi, please find some patches, most of them are for the room games again, also an improvement for the contact manager: Libervia: - send rich text to all CC recipients, I filed a bug report about the rendering: http://bugs.goffi.org/show_bug.cgi?id=58 - recipient and contact manager: fixed issues with the autocomplete list, avoid duplicate contacts in a contact list, signal invalid contacts with a red border, check for invalid contacts in the form before saving - unique GUI based on StackPanel for joining/inviting MUC (with game or not). The joinMUC method can be called with empty argument in that case a unique name will be generated, eventually the game preffix will be inserted (as it was done before). The invitation panel displays the list of connected contacts, it is updated live. Please have a look and let me know what should be changed. - some symbols (cards, music...) let you know who is playing in the room. When you are waiting to start a tarot game you can see who is ready and who you are waiting for :) SàT plugins (MUC / games): - silently discard MUC invitations if you're already in (that's conform to the XEP) - in RoomGame all the messages are sent from a common method "send", also added some parameters to manage who can invite, who can join, who to wait for... some check***Auth methods do the management, there are for sure some remaining issues that I will fix when they are discovered - joining a game that is already launched may be possible, regarding these parameters and the invitation list. Leave and join a game again is partly managed: new tarot round is launched, we should keep playing the same round instead (known issue: when the new round is launched, players who were there already get an additionnal deck - I need to reinit the table) - moved tools/frontends to frontends/tools and tools/plugins to plugins... Best regards, Adrien -------------- section suivante -------------- Une pièce jointe autre que texte a été nettoyée... Nom: lib_roomgame.py Type: text/x-python Taille: 103002 octets Desc: non disponible URL: -------------- section suivante -------------- Une pièce jointe autre que texte a été nettoyée... Nom: sat_roomgame.py Type: text/x-python Taille: 101742 octets Desc: non disponible URL: From goffi at goffi.org Fri Nov 22 21:28:22 2013 From: goffi at goffi.org (Goffi) Date: Fri, 22 Nov 2013 21:28:22 +0100 Subject: [dev] =?iso-8859-1?q?libervia=2Eorg_mis_=E0_jour_/_libervia=2Eorg?= =?iso-8859-1?q?_updated?= Message-ID: <528FBE66.4050104@goffi.org> english below, une petit note pour dire que libervia.org a été mis à jour. ++ Goffi -- Just a small note to say that libervia.org has been updated. ++ Goffi