Gajim - 2024-03-24


  1. 222m5

    > also which one is the last version without workspaces? Ge0rG: 1.3.3 (workspaces were introduced in 1.4.0) https://gajim.org/post/2022-05-11-gajim-1.4.0-released/ https://gajim.org/post/2022-04-30-development-news-april/

  2. lovetox

    intelfx, yeah on first look that would seem more appropriate

  3. lovetox

    intelfx, if you see such small refactor work, please make a separate MR for that

  4. lovetox

    and rebase your MR after its merged

  5. bot

    lovetox pushed 1 commits to branch python-nbxmpp/master feat: Add XEP-0215 namespace - https://dev.gajim.org/gajim/python-nbxmpp/-/commit/6e994095017848cf9601bb81027454ad8808035c

  6. mkf pats bot

  7. sshuhui removed by cal0pteryx

    Spam

  8. sshuhui removed by cal0pteryx

    Spam

  9. sshuhui removed by cal0pteryx

    Spam

  10. PMR

    i am not clicking that stuff mister stranger

  11. a moderator removed a message

    Spam

  12. a moderator removed a message

    Spam

  13. a moderator removed a message

    Spam

  14. intelfx

    lovetox, yep for now I'm working in my branch but I'll split everything into separate MRs of course

  15. cal0pteryx

    intelfx: great to see you are still working on this

  16. ann

    <3

  17. Ge0rG

    222m5: thanks very much!

  18. lovetox

    just so people know, in Gajim 1.3 when it was multi window based, we had a option to have a window mode, where groupchats and single chats were separated into different windows, when we did design the 1.4 one window design, we thought its a useful feature to group certain chats, especially so people which used this window mode could get the same functionality

  19. lovetox

    so a workspace is simply a grouping of chats

  20. lovetox

    you dont need to use it if you dont want to, then you simply have only one group

  21. chud

    They get in the way tho. The pencil button which makes me (and not only me as discussed here) think it's the "write message" button. Why is the "My Workspace" label so big, do people who use them need to be constantly told which one it is, and in such big letters?

  22. cal0pteryx

    chud: the button has already been changed, the next version will provide a different solution. And the label size is just your oppinion ;)

  23. chud

    The button is also just an opinion

  24. lovetox

    also it has nothing to do with the question "why are there workspaces"

  25. lovetox

    though i thought we could use a better icon as default

  26. lovetox

    and maybe the default Worspace should be called "Chats"

  27. cal0pteryx

    > The button is also just an opinion This was a valid point is what I wanted to say. The button is now only shown when hovering the title, which makes the context clearer

  28. chud

    I'm not saying they shouldn't be there, but it's probably best if an obscure, unique feature you don't encounter in any popular messenger nowadays, doesn't get in the way. Yes, calling it chats would be a good idea imo

  29. lovetox

    yeah if we name it Chats, nobody will ever ask anymore what a workspace is

  30. lovetox

    :d

  31. lovetox

    they would only discover if they click the + button

  32. chud

    yes

  33. chud

    actually, pencil would probably be a better icon for a new message than a plus

  34. chud

    because now you have two pluses and I think to a new user it may not be obvious which plus does which

  35. lovetox

    but the + opens a menu, which is not only for writing message

  36. lovetox

    someday i would want some universal search bar always visible

  37. chud

    >but the + opens a menu, which is not only for writing message oh, right

  38. bot

    wurstsalat pushed 1 commits to branch gajim/master fix: Catch errors when trying to store pasted image - https://dev.gajim.org/gajim/gajim/-/commit/28c4edc45ef586925859d51acc2d886392536dc9

  39. intelfx

    can someone help me debug a thing that I did with async code in nbxmpp guts? 🙃

  40. intelfx

    I tried to port nbxmpp's iq_request_task() to gajim here: https://dev.gajim.org/gajim/gajim/-/merge_requests/995/diffs?commit_id=5d7348d1d409b93dfdce01fa795836db917cbddf

  41. intelfx

    this, in turn, was used to send the XEP-0215 request from gajim Discovery module: https://dev.gajim.org/gajim/gajim/-/merge_requests/995/diffs?commit_id=4e80e1bc9ac400a3ed3cfec5f7a969ddca535e3c#604c873585e1777d16c20ff7606d35fe19081c75_182_256

  42. intelfx

    (it should probably be lifted to nbxmpp, but for now I guess it lives here)

  43. intelfx

    but the response never arrives

  44. lovetox

    so you are saying the request is sent but the server never answers?

  45. lovetox

    so not a problem with your code?

  46. intelfx

    I'm most likely using the async machinery incorrectly

  47. lovetox

    but this would be easy to check, open the xml console, and see if xml is sent to the server

  48. lovetox

    but yeah all iq requests should be added to nbxmpp into some module

  49. lovetox

    why not move the code there? i see no problem to merging it fast, if thats your reason to add it to Gajim

  50. intelfx

    I was just prototyping, easier to write all code in one place

  51. intelfx

    OH, I just missed my debug print for some reason when grepping through the logs

  52. intelfx

    I blame tmux :D

  53. intelfx

    nevermind, everything works as expected (what I wrote is still broken, but for a different reason entirely)

  54. intelfx

    I'll move it to nbxmpp as soon as I confirm the thing works at all

  55. intelfx

    and thanks, I did not know about the xml console

  56. lovetox

    to be honest i never thought to use iq_request_task in Gajim

  57. lovetox

    so this code was not designed to use by other applications

  58. intelfx

    how does Gajim deal with similar needs?

  59. intelfx

    does it just fire of iq stanzas and declare module-level handlers for responses?

  60. intelfx

    does it just fire off iq stanzas and declare module-level handlers for responses?

  61. lovetox

    it does not, all iq requests are implemented in nbxmpp

  62. intelfx

    I think at least jingle does its own?

  63. lovetox

    ah yeah .. i forgot jingle :D

  64. cal0pteryx

    I think back when all the modules were refactored, jingle was the only one left in gajim

  65. lovetox

    you can use client.send_stanza()

  66. lovetox

    it has a callback arg, which notifies you if the iq response comes

  67. lovetox

    but the callback arg is also not forwarded from gajim to the nbxmpp client, instance, so you need to call the nbxmpp client instance yourself, or add the callback arg to gajims client class

  68. intelfx

    yeah, jingle uses nbxmpp.Client's send()

  69. intelfx

    but it does not use per-stanza callbacks at all

  70. lovetox

    yes its super old code

  71. intelfx

    it has a module-level handler and maintains a dict of iq ids itself

  72. intelfx

    hm, I'm thinking about moving this thing to nbxmpp and there's a slight issue

  73. intelfx

    so the server sends us a response directly to our iq request, but it can also push new updates voluntarily

  74. intelfx

    and I'd like to reuse the parser

  75. intelfx

    but if the parser gets moved to nbxmpp, how would I handle the pushes?

  76. intelfx

    (this is XEP-0215)

  77. lovetox

    checkout the blocking.py module in nbxmpp

  78. lovetox

    this xep has also iq pushes

  79. lovetox

    you parse everything in nbxmpp into some dataclass struct

  80. lovetox

    and attach it to the properties struct

  81. lovetox

    then you simply define in gajim a stanza handler for the xep namespace and iq

  82. lovetox

    and access there the properties struct

  83. lovetox

    the idea how this works is, that nbxmpp also creates a stanza handler but with a much lower priority

  84. lovetox

    so it gets the iq, parses everything into some dataclass, and then passes the event on with the added info

  85. lovetox

    later gajim gets it

  86. intelfx

    aha, I see

  87. intelfx

    but I do not see where the dataclass is constructed at all?

  88. intelfx

    the BlockingProperties in this case

  89. lovetox

    in _process_blocking_push()

  90. lovetox

    every stanzahandler callback gets a properites struct passed, and you can simply assign whatever you want to this struct

  91. lovetox

    it gets passed on to every handler afterwards

  92. intelfx

    ah so it is not really an instance of `class BlockingProperties` but just a generic something?

  93. lovetox

    its a subclass of IqProperties

  94. lovetox

    which is simple a class with a lot of attributes

  95. lovetox

    nothing special, its basically a place where every handler can attach info to

  96. lovetox

    so the next handler can see it

  97. lovetox

    dont know why i added a subclass there .. have to look

  98. intelfx

    I see, so it _is_ an IqProperties then

  99. lovetox

    this .. is bullshit, i think i did that only for type hints

  100. intelfx

    IqPropertiesBase is never instantiated

  101. lovetox

    it never gets really instantiated

  102. intelfx

    yep

  103. lovetox

    @dataclass class IqProperties:

  104. lovetox

    that is the real thing

  105. intelfx

    yep I just realized that

  106. lovetox

    its all fucked and a hack on top of some hack

  107. intelfx

    so the type hints are wrong

  108. lovetox

    dont question the sense in all that :D

  109. lovetox

    i planned to rewrite the whole thing a year ago, but .. it kind a works ok .. so other things always had priority

  110. intelfx

    okay I'll do something similar then

  111. intelfx

    > i planned to rewrite the whole thing a year ago, but .. it kind a works ok .. so other things always had priority yeah ain't that the truth :D

  112. intelfx

    thanks, it'd have likely took me several hours to untangle this by myself

  113. intelfx

    thanks, it'd have likely taken me several hours to untangle this by myself

  114. lovetox

    and iq_request_task was invented so i can get the result of an iq inline without callback

  115. lovetox

    mostly for pubsub stuff, where you publish, then it fails, then you pull config, then you change config, then you publish again

  116. lovetox

    like 4-5 iq requests until you published something

  117. lovetox

    if you do this all with callbacks, its callback hell

  118. intelfx

    yeah, callbacks are evil

  119. intelfx

    I think the entire world had realized that a while ago :D so we have async/await now

  120. lovetox

    thats basically the same thing python does with its asyncio stuff, but they have more syntax sugar

  121. intelfx

    yup exactly

  122. intelfx

    I guess nbxmpp predates async/await?

  123. lovetox

    no, we cant use it because we dont use the python main loop

  124. lovetox

    we use the GLib mainloop, and it has no bindings to the python main loop

  125. lovetox

    and we need to use the GLib mainloop because GTK only works with the GLib mainloop

  126. intelfx

    hmm, but can't you use async/await with any eventloop if you do the glue code yourself

  127. lovetox

    but that glue code does not exist

  128. intelfx

    yeah

  129. lovetox

    and smarter people then me failed :)

  130. intelfx

    perhaps I'm not smart enough to see the problem... doesn't async def give you the same generator as you would've written by hand

  131. intelfx

    then you can manually push the data with send, just like Task does by itself

  132. intelfx

    then you can manually push the data with send, just like Task does already

  133. lovetox

    maybe, i also wondered if some of the stuff i build there is not somewhere in python already

  134. lovetox

    but never bothered to check

  135. lovetox

    i have to say im not a huge fan of the whole async/await stuff, it makes some thing easier, but if the whole application is littered with it, for me its another kind of hell :D

  136. intelfx

    yep, it's pervasive

  137. intelfx

    perhaps you could combine old-style functions and callbacks with async/await where it makes things easier

  138. intelfx

    anyhow, all that stuff is something for another day :D

  139. lovetox

    Gajim and nbxmpp is like this really messy thing, that you want to clean up, and then you clean and clean, and 5 years go by and you look at the code from 5 years ago and thing, hm i need to clean this up again :D

  140. chud

    I was experimenting with just that - async/await on the glib event loop in gajim for jingle... https://dev.gajim.org/wusspuss/gajim/-/blob/master/gajim/common/jingle_bells/jingle_av_session.py?ref_type=heads#L262 Combining async/await with existing callbacks-based code is awkward, but I think not as awkward as adding more callbacks.

  141. chud

    That branch now supports video calls and runs on windows btw

  142. chud

    I achieved async/await support by implementing very simplistic Task and Future like those in asyncio. It would've been nicer if the asyncio evloop was actually integrated with that of glib, but it's been years and not implemntation came about that would at least support windows

  143. chud

    while my approach gives much much more limited concurrency primitives, it takes no effort whatsoever to support different platforms, it exists a level above that basically

  144. chud

    while my approach gives much much more limited concurrency primitives than those of asyncio/trio, it takes no effort whatsoever to support different platforms, it exists a level above that basically

  145. lovetox

    looks interesting, i always thought you need to use the even loop to use the syntactic sugar async/await

  146. lovetox

    but seems thats not the case

  147. chud

    well of course it can't depend on an event loop if it's just syntactic sugar 🙂

  148. lovetox

    the only thing sometimes would be nice, is to fire and wait for 2-3 iqs in a row

  149. chud

    Python did overcomplicate coroutines imho compared to Tcl. You can't really use them bare, send() stuff is awkward

  150. lovetox

    so i dont think we need any special concurrency primitives

  151. chud

    >the only thing sometimes would be nice, is to fire and wait for 2-3 iqs in a row gather() already takes care of that and I already implemented that in a couple of hours

  152. chud

    so like what would be the requirements to actually get this thing merged I haven't implemented dtmf yet, is that a show stopper? Other than that it lacks the option to start and stop the video during the call. But it otherwise works with both Dino and Conversations. I figure a proper flatpak would be one requirement, a windows build script I hope can wait (I have run it on windows successfully, but had to install deps by hand).

  153. chud

    >gather() already takes care of that and I already implemented that in a couple of hours oh you said in a row, yeah that's not gather that's just await

  154. chud

    Honestly this is mostly an experiment to even see how async/await would play along with an existing, cb-based codebase https://conference.gajim.org:5281/pastebin/aa18cac5-bbf3-4432-92a8-cdd004fc0901

  155. chud

    https://draugr.de/upload/00f530bb49b4e1685114d28f8bb6fb44b2fcbc2f/uezVOqQ81o9YkGZGrkihRlakFBGnuxUHF2Ru8KEC/Screenshot_at_2024-03-24_15-08-27.png

  156. chud

    was the video call window already this fugly or did I screw it up

  157. chud

    was the original video call window already this fugly or did I screw it up

  158. chud

    I don't think I changed much layout-wise, but the video widget is instantiated differently so maybe some setting is off for it

  159. lovetox

    i dont know, i never saw the video call window

  160. chud

    >may look simple in writing, with state machines they just turn into a huge mess not to mention... try unit testing the state machine stuff... like when you want to wait for an event and each wait turns into a callback, and instead of top-to-bottom human writing it turn into boustrophedon or smth

  161. lovetox

    i would say start with making an MR

  162. lovetox

    yeah i believe that it definitly has some pros, but like everything it also has cons, one beeing that i need to understand the near 1k loc async primitives module

  163. lovetox

    libdatachannel seems not be packaged widley, i would say this is definitly a topic

  164. chud

    It is packaged for archlinux at least and it works on windows unlike what gajim currently has. It's easy to build also (a single self contained repo basically).

  165. chud

    It is packaged for archlinux at least and it works on windows unlike what gajim currently has. It's easy to build also (a single self contained repo basically, no extra deps).

  166. chud

    > yeah i believe that it definitly has some pros, but like everything it also has cons, one beeing that i need to understand the near 1k loc async primitives module It's only 500 loc, of which I think 1/3 is copypaste from asyncio and another 1/3 is lose adaptation. But yes may be tricky to understand as these ideas in general are rather new. I also got unhinged there and implemented a bit of "structured concurrency", i.e. nurseries, which I think only came about in asyncio like a release or two ago

  167. chud

    I did hold back from using python 3.11 language futures (exception groups). If I hadn't, it'd probably be yet shorter.

  168. chud

    also the adhoc_async stuff could in principle just be another library. In an ideal world, we'd get asyncio-glib integration

  169. chud

    also the adhoc_async stuff could in principle just be another library. In an ideal world, we'd get asyncio-glib integration, but in years and years not even one implementation of that has popped up that so much as supported windows. Also , I think my thing may actually be less error prone, or more like the errors won't be as severe. Event loop integration if you actually look into it can be exceptionally tricky especially in edge cases, and harder to debug.

  170. chud

    My thing deals with higher levels of GLib, which are closer to "interface" than to "internals", so I would also bet on my approach when it comes to future version compatibility (gnome guys love to break interface, I can only imagine how much they rework their internals)

  171. chud

    My thing deals with higher levels of GLib, which are closer to "interface" than to "internals", so I would also bet on my approach when it comes to future version compatibility (gnome guys love to break interface, I can only imagine how much they rework the internals)

  172. chud

    My thing deals with higher levels of GLib, which are closer to "interface" than to "internals", so I would also bet on my approach (as compared to event loop integration) when it comes to future version compatibility (gnome guys love to break interface, I can only imagine how much they rework the internals)

  173. chud

    > I also got unhinged there and implemented a bit of "structured concurrency", i.e. nurseries, which I think only came about in asyncio like a release or two ago But I think it suits the case: a session is in a way comprised of several parallel routines (like xmpp singlaling, playing the contents, etc), which in turn may spawn new processes for their need. With nurseries, none will be left dangling, and I make extra sure of it in the unit tests

  174. chud

    > I also got unhinged there and implemented a bit of "structured concurrency", i.e. nurseries, which I think only came about in asyncio like a release or two ago But I think it suits the case: a session is in a way comprised of several parallel routines (like xmpp singlaling, playing the contents, etc), which in turn may spawn new routines for their need. With nurseries, none will be left dangling, and I make extra sure of it in the unit tests

  175. lovetox

    i agree, im not waiting for a event loop integration, it seems not enough people need this or it would already be here

  176. lovetox

    for building on windows, the way to go would be to add the package to msys

  177. lovetox

    https://www.msys2.org/wiki/Creating-Packages/

  178. lovetox

    they use pacman, and arch style package files, so it should not be a big challenge?

  179. lovetox

    i definitly dont want to build this in our CI, this would be one more additional thing that can break

  180. chud

    I already made a draft libdatachannel pkgbuild for msys2

  181. chud

    https://github.com/wusspuss/libdatachannel-mingw-pkgbuild/blob/main/PKGBUILD

  182. rude

    that's a lot of messages everyone's life just flashed in front of me

  183. chud

    testing windows is a huge PITA for me though as I only have it in qemu and it's absurdly slow. And installing it on the host... oh boy, having to shrink the linux partition, repair grub etc etc, I'm not eager to waste a day on just that

  184. rude

    chud, Don't do that chud

  185. rude

    upgrade your hardware

  186. notnite

    woah, does this do a/v on windows or am I misunderstanding

  187. chud

    yes

  188. notnite

    damn, I daily drive windows so I might be able to assist

  189. notnite

    (wrt packaging)

  190. chud

    I also made a draft pkgbuild for libdatachannel python bindings https://github.com/wusspuss/libdatachannel-python-mingw-pkgbuild/blob/master/PKGBUILD it seems on windows they have to be installed via the msys package rather than pip because of cffi/toolchain stuff

  191. chud

    so basically to get them to work just libdatachannel and libdatachanel-python need to be packaged into the windows distribution. and it has to be built from my branch ofc

  192. chud

    so basically to get them to work just libdatachannel and libdatachanel-python need to be packaged into the windows distribution if I'm not mistaken. and it has to be built from my branch ofc

  193. lovetox

    if you checked at it works at all on windows, i would concentrate on linux, its unlikely that any stuff that does not work on windows will be fixable in Gajim code

  194. lovetox

    im saying this under the assumption, that you said before that you tested a/v on windows and it works

  195. chud

    yes it did. But only made like two two or three test calls on windows so there may be pitfalls I'm not aware of. On linux I have actually used it in practice to call ppl