• Pr chevron_right

      Profanity on Pinephone

      pubsub.slavino.sk / profanity-blog · Wednesday, 2 February, 2022 - 19:47 edit · 1 minute

    Hi all,

    So far, in my pinephone I used mainly GUI applications, because I was using a touch screen. Terminal applications are not user-friendly when it comes to one-handed operation.

    I tested different distributions on my pinephone (mobian, manjaro, archarm), but usually most based on Phosh. In my opinion it is currently the best mobile graphics environment and stable as well.

    In Phosh I tested few xmpp clients:

    • the default application installed with Phosh is chatty, a combine that supports sms / mms / xmpp (OMEMO)
    • Dino from repo: handy
    • Gajim

    I know there are KDE plasma applications as well, but during my testing, plasma was unusable and I even gave up installing it. My pinephone comes with preinstalled Plasma factory image but I could not even upgrade to latest Plasma version, So I gave up KDE :(

    In my opinion, Dino works the best on PinePhone with Phosh.

    Recently I ordered keyboard dedicated to pinephone(pro), so I decided that I will also test terminal xmpp client.

    I also decided to check profanity as I use it on my home server and it works perfectly, but I was curious how it would handle on pinephone. I installed it and everything worked well. Just one thing: pinephone terminal is small to read more than 2 lines. I wanted to scroll window Up to be able see previous content. Well, first I changed the resolution in Phosh from 200% to 150%, and I could see more than two lines.

    But, I still had a trouble scrolling the main window in profanity

    video: ppkb keyboard issue

    I looked at profanity keybindings and in the User Interface Navigation section I found that I should use PageUp/PageDown keys, but looking at Pinephone wiki this keyboard does not have PageUp/PageDown keys.

    I had to do key mapping in profanity. Using following url profanity keybindings quickly I found solution.

    Basicaly, I created a file ~/.config/profanity/inputrc with content

    $ if profanity
    "\ C-p": prof_win_prev
    "\ C-n": prof_win_next
    "\ C-j": prof_win_pageup
    "\ C-k": prof_win_pagedown
    "\ C-h": prof_subwin_pageup
    "\ C-l": prof_subwin_pagedown
    "\ C-y": prof_win_clear
    $ endif
    

    After starting profanity, I was able to scroll window with content using following shortcuts

    • C-j - scroll up
    • C-k - to scroll down

    video: ppkb keyboard scroll

    Here you can see some photos.

    Profanity screeen 1Profanity screeen 2


    Značky: #XMPP

    • Pr chevron_right

      Attention, attention!

      pubsub.slavino.sk / profanity-blog · Saturday, 5 June, 2021 - 13:07 edit

    Hello folks,

    we have implemented an attention flag in profanity.

    The attention flag can be used to mark chats and groupchats where you would like to pay particular attention.

    This is only available on master, but will be in the next release (0.11.0).

    How it works

    Open the chat or groupchat window and press shortcut ALT+F . Profanity will display a line to inform you when the attention flag has been activated and deactivated.

    05/06/21 15:25:49 - Staff restaurant: Lunch recommendations:
    05/06/21 15:27:04 ! Attention flag has been activated
    05/06/21 15:27:04 ! Attention flag has been deactivated
    

    You can use the shortcut ALT+F to toggle the flag.

    The /wins attention command can be used to display all windows with you pay attention.

    15:38:19 - 3: Room roomA@conference.domain.tld
    15:38:19 - 15: Room roomB@conference.server.tld, 1 unread
    15:38:19 - 28: Room roomC@chat.server.tld
    15:38:19 - 29: Room roomD@chat.server.tld, 3 unread
    

    You can just circle around the marked windows with shortcut ALT+M .


    Značky: #XMPP

    • Pr chevron_right

      OMEMO

      pubsub.slavino.sk / profanity-blog · Friday, 27 November, 2020 - 16:14 edit · 1 minute

    OMEMO with profanity.

    Hello OMEMO!

    OMEMO needs crytographic materials. You can generated this crytographic materials via /omemo gen . If you have more than one device, make sure you are trusting your other devices. Check your fingerprints via /omemo fingerprint . You may wont trust all your devices:

    /omemo trust <Your XMPP-ID> <Your fingerpint>
    

    Check the fingerprint of your buddy. List the fingerprints of your buddy via

    /omemo fingerprint <XMPP-ID of your buddy>
    

    Check the fingerprints with you buddy over a secure medium (phone or singed OpenPGP message) and trust the buddy’s fingerprint via the command:

    /omemo trust <Buddy's XMPP-ID> <Buddy's fingerpint>
    

    You can start a OMEMO Session via the omemo-start command /omemo start <buddy's XMPP-ID> .

    Debugging

    Get the device list of your Buddy. Change the to and the from tag of the line shown below.

    <iq type='get' from='your@domain.tld' to='buddy@domain.tld' id='getOmemoDeviceList'><pubsub xmlns='http://jabber.org/protocol/pubsub'><items node='eu.siacs.conversations.axolotl.devicelist'/></pubsub></iq>
    

    Use the /xmlconsole to open the XMP Console Window and sent those line to your server.

    The Server should return a result of the iq with id getOmemoDeviceList . There should be a item -Tag with the id current followed by a list of device id.

    <items node="eu.siacs.conversations.axolotl.devicelist">
    	<item id="current">
    	<list xmlns="eu.siacs.conversations.axolotl">
    	<device id="174235744"/>
    	<device id="71071234"/>
    	<device id="22318128"/>
    	</list>
    	</item>
    </items>
    

    The known devices and fingerprints are stored in ~/.local/share/profanity/omemo/<account>/known_devices.txt . The trust information are stored in ~/.local/share/profanity/omemo/<account>/trust.txt .

    QR Code

    If you need a QR Code of you Fingerprint, check xmppc. xmppc is a XMPP Command Line Tool which can be used to generate a QR Code .


    Značky: #XMPP

    • Pr chevron_right

      Profanity 0.9.0

      pubsub.slavino.sk / profanity-blog · Tuesday, 9 June, 2020 - 13:46 edit · 5 minutes

    Four months and 350 commits after 0.8.1 we are happy to release 0.9.0 .

    7 people contributed code to it: pasis , wstrm , DebXWoody , toogley , pmaziere , moppman and jubalh .

    Thanks to everybody who was involved, be it testing, writing documentation, updating the website or whatever you did! I also would like to express my gratitude to my sponsors mdosch and wstrm !

    Profanity

    LMC

    We support XEP-0308: Last Message Correction now. Enable it with /correction on . If you mistyped a word just type /correct and hit tab to autocomplete the last sent message, then fix it and press enter.

    Slashguard

    In our MUC we often see messages like “q/uit” or people having whitespaces before a command " /quit”. To help you to avoid such mistakes we introduce slashguard. Once enabled ( /slashguard on ) Profanity won’t send messages that contain a backslash in the first four letters.

    New parameters

    You can specify a logfile upon startup via the new -f option: profanity -f TEST will log to ~/.local/share/profanity/logs/TEST.log .

    Hopefully this is useful for our testers!

    The new -t option will let you select a theme right at startup: /profanity -t bios . This is useful if you run multiple instances of Profanity. Maybe you have multiple accounts and want to visually destinguish between them.

    Did you know we have a blogpost that should help you create such a setup with tmux?

    Titlebar

    Previously you could choose whether to display the MUC name or MUC title in the titlebar. Now you can choose to do both or neither. /titlebar use name|jid became /titlebar show|hide name|jid .

    What software is this server running?

    You can now use XEP-0092 not just to request client software information but also server software information. Use /serversoftware domain.org .

    Theming

    You can now colorize your trackbar by using main.trackbar in your theme.

    And you can use UTF-8 symbols as your OMEMO char.

    You can now choose not to colorize your own nick if you enabled XEP-0392. Use /color own off if you want consistent color generation for everybody else but not for yourself.

    MUC history messages were colored in one uniform color (grey by default). Many users would just like to get the same coloring and hilighting for freshly received messages. So we removed the uniform color feature #1261 .

    And there is a new theme based on default: jubalian. Check it out ;)

    Avatars

    Avatars can not only be downloaded but also opened automatically now. In 0.8.x you used /avatar odin@valhalla.org . Now you can either just download it /avatar get odin@valhalla.org or open it: /avatar open odin@valhalla.org .

    By default we rely on xdg-open, so your default image viewer will be used. But you can choose to configure it yourself. For example to use feh instead: /executable avatar feh

    Open URLs

    People often had issues with URLs that were too long and then broken into several lines. If they were in a MUC and had the occupants panel enabled, this made it impossible to click on the URL to open it because it was not one consecutive string.

    If you run Profanity locally (not on a remote machine where you log in via ssh) you can use use /urlopen to open an URL in your browser.

    We use xdg-open again. But you can configure it with /executable urlopen firefox .

    OMEMO

    OMEMO autocompletion had some quirks. We fixed them! We also stopped requesting the device list in non anon MUCs.

    Scrolling

    Sometimes it happened that you scroll up a window to read up on something. Then switch to another application and later forget that you actually scrolled up. Why is noone saying anything in this MUC anymore?

    In this version of Profanity we display a hint in the titlebar if a window is scrolled. Use titlebar.scrolled to theme it.

    Legacy authentication

    Some servers still only allow legacy authentication #1236 . If you want to connect to them you will need libstrophe 0.9.3 and Profanity 0.9.0.

    Use /connect <account> [auth default|legacy] or /account <account> set auth default|legacy .

    Too many tabs

    In case you many opened windows you might want to only display the ones that have something going on in them. Use /statusbar show|hide read to configure this to your liking.

    Bookmarks

    We now print the boomark names when using /bookmark list . You can also now add a name when using /bookmark add .

    Gajim uses a custom way to save whether (autojoined) bookmarks should be minimized. When we updated a bookmark in Profanity we didn’t respect this flag and it was overwritten. Now Profanity works nicer with Gajim #1326 .

    When you use multiple clients you probalby have some MUCs that you want to join on all devices. You use the autojoin flag for these cases. If you want to ignore the autojoin flag in a Profanity instance you can use /bookmark ignore .

    Narrow terminals

    We can’t support all edge cases and users will need to have a reasonable window size to use Profanity properly. We fixed a bug about a messed up titlebar if a user had a very long resource name #715 .

    Change in default settings

    To give a better experience to new users we changed the default settings for some popular features.

    • Allow message correction
    • Send receipts
    • Enable carbons
    • Enable type/chat states

    Under the hood

    Plenty of memory leaks where discovered and fixed. Profanity should run a lot smoother now. The UI and message functions were cleaned up in preparation to add MAM support.

    Messages are now logged in an sqlite database which is located at ~/.local/share/profanity/database/accountname/chatlog.db . All later retrieval (history) is done using this database from now on. We still output regular chat logs in ~/.local/share/profanity/chatlogs if the user enabled it ( /loggin chat|group on ) but don’t rely on them anymore. They are just for the users convenience.

    This will also benefit us when implementing message searching #206 or MAM #660 for example.

    We always send delivery receipts and not just if the other client advertises it #1268 .

    Some users experienced connectivity problems. Several things were done by DebXWoody to improve this.

    We also had an edge case where the roster only displayed offline contacts because we received the presence after the roster.


    Značky: #XMPP

    • Pr chevron_right

      Contributing a Patch via GitHub

      pubsub.slavino.sk / profanity-blog · Wednesday, 15 April, 2020 - 11:50 edit · 1 minute

    Several people mentioned in our MUC that they have problems contributing code to the Profanity repo on GitHub because “forking all the time is cumbersome”.

    Let me show you an example workflow. Since I don’t think it’s cumbersome at all. I assume you have an account on GitHub and are logged in. First thing we do is fork the repo. So go to https://github.com/profanity-im/profanity and click on “Fork”. Now you should be at your fork, in my case this is: https://github.com/jubalh/profanity/

    Let’s go into our developtment directory: cd dev

    Now you clone our repo: https://github.com/profanity-im/profanity/

    Change to the directory and check out a branch: cd profanity; git checkout -b fix/typo-in-readme

    Add our own fork: git remote add mine https://github.com/jubalh/profanity

    Make a change: $EDITOR README.md .

    Commit your change: git add README.md ; git commit

    And push the change to our forked repo: git push mine

    In the browser go to https://github.com/jubalh/profanity again and click on “Pull Request”.

    Write some nice text there.

    A couple of days later you want to contribute something else.

    So we go to our sources: cd dev/profanity

    Pull the latest changes from master, hopefully including our own changes in case they got merged:

    git checkout master; git pull

    And then we do the same like before. We check out a new branch, we do our commits there. We push them. So this is the same like one wouldn’t use GitHub but git in general. The only thing that is “more work” is to go to the website and create a pull request. The “forking” actually only happens once.

    If you don’t like browsers, you can use something like hub .


    Značky: #XMPP

    • Pr chevron_right

      XML console in Profanity

      pubsub.slavino.sk / profanity-blog · Thursday, 9 April, 2020 - 18:16 edit · 2 minutes

    Profanity is an XMPP client that allows you to chat with friends. But one feature makes it more than just a client. The name is XML console.

    It has been implemented for a long time now, but hasn’t found wide spread within Profanity community. I still believe that the XML console is unpopular because users haven’t chance to find it and to try it out. And Profanity community has a number of experts who use XMPP in their projects. If you’re one of them, Profanity can make life easier for you.

    XMPP clients implement an XML console mostly for debugging purpose. To see XMPP stream and analyze issues post factum. But Profanity has gone further and implemented XML console with ability to send any data. One this small property turned Profanity into a powerful developer tool. Let’s see how to use it:

    To open the XML console, simply run command: /xmlconsole . It opens a new window with content of XMPP stream. Profanity starts displaying only new XMPP stanzas. You won’t see the part of XMPP stream before you open the window. Format of the content is as follows:

    21:24 - SENT:
    21:24 - <iq id="id1" type="get"><ping xmlns="urn:xmpp:ping"/></iq>
    21:24 -
    21:24 - RECV:
    21:24 - <iq id="id1" to="pasis@jabber.ua/profanity.754a" type="result"/>
    21:24 -
    
    

    Any text you send in the window is inserted into XMPP stream as is. So, you can simply type a stanza, press enter and observe server behaviour. Why is it so cool? Because you don’t have to write any code while you learn a XEP or server behaviour.

    For example, you’ve decided to implement roster support with a low-level library like libstrophe. Instead of debugging with writing code, printing text to terminal or logs, you can connect to your server with Profanity and type in the XML console:

    <iq type="get" id="id2"><query xmlns="jabber:iq:roster"/></iq>
    

    Now, you can observe what server replies in practice. In this way, you can debug process which requires multiple iterations.

    Hint: if you type a stanza without child element, don’t forget to close the tag! Pay attention to the “query” stanza in the above example - it has ‘/’ before closing tag.

    And even you send something wrong, server will close connection and Profanity will reconnect automatically. So, this is much faster than rewriting your code.

    To demonstrate a different usecase, let’s refer to XEP-0363. After requesting a slot with an IQ stanza, you can upload file using curl command-line tool. Again, no need to write any code for debugging.

    Hope you will find this feature useful for you!


    Značky: #XMPP

    • Pr chevron_right

      How to run profanity instances within tmux

      pubsub.slavino.sk / profanity-blog · Tuesday, 3 March, 2020 - 13:49 edit

    If you have more than one XMPP account, you may run one profanity process per account. For example profanity -a AccountName .

    It’s possible to start a tmux session with one window for each profanity instance.

    Create a tmux configuration file, e.g. in ~/.config/tmux .

    mkdir ~/.config/tmux
    touch ~/.config/tmux/profanity.conf
    

    Within the configuration file, you create a tmux session named Profanity . Followed by one window per XMPP Account. Each window will run a profanity followed by -a accountname .

    session-name Profanity
    neww -n "Private" profanity -a private 
    neww -n "Work" profanity -a work
    neww -n "Movim" profanity -a Movim
    

    If you are using bash, you may like to define a alias in ~/.bash_aliases .

    alias profanitymux='tmux new-session "tmux source-file ~/.config/tmux/profanity.conf"'
    

    Done! You can start your profanity instances within a tmux session by running profanitymux . tmux will create one window for each profanity instance. You can switch the tmux windows with CTRL-B + 1 or CTRL-B + 2,…


    Značky: #XMPP

    • Pr chevron_right

      Last Message Correction

      pubsub.slavino.sk / profanity-blog · Friday, 14 February, 2020 - 10:34 edit · 1 minute

    From 10th to 14th February 2020 we had Hackweek 19 at SUSE. Part of that time I used to finally implement the long (since 2016!) sought after Last Message Correction feature, aka XEP-0308 .

    See my Hackweek project and the corresponding pull request .

    Usage

    To enable incoming and outgoing corrections users need to enable it with /correction on , see /help correction for more details.

    Now we write a message to a friend /msg Martin Hey therr! .

    Ouch! Already a typo.

    Let’s make this right: /corr<TAB> <TAB> will autocomplete to /correct Hey therr! which then can easily be fixed and re-send.

    mistakecorrected

    Details

    The feature is only available in the development version of Profanity. In the master branch on git. So it’s not yet ready for release.

    Master branch corresponds always to our development and doesn’t guarantee anything. It’s where we develop test and experiment. We write these blogposts from time to time to inform our users and sponsors about what we are currently working on.

    The LMC feature is in there. But for the correct behaviour we need to rewrite the UI code. We could hack a ‘from’ field in but we want to think more carefully how to implement it nicely. For this reason in the current state we don’t check the ‘from’ attribute of the sender. Because at the time of drawing so far we don’t have this information.

    Since LMC is off by default noone is at harm. But people who choose to enable it need to be aware that in theory it would be possible for other users to send special messages where they could “correct” a message of someone else. We think the damage and likeliness from this is quite low. And once again, this is only in our development version of Profanity.

    Done!

    Today, on 2020-03-09, we were able to finish LMC properly. So if you use master from a23d4e4af7c10f6762577940a12983903bf4428d you are good.


    Značky: #XMPP