libera/#maemo-leste/ Friday, 2024-11-08

freemangordondsc_: is it conversations that fills the db or eds tp plugin?07:24
freemangordonalso, please LMK when you want to start with abook integration, so I can start working on abook<->qt integration07:26
dsc_freemangordon: incoming messages are inserted by conversations into rtcom db14:19
dsc_or just messages in general14:20
dsc_for contact list (roster), it is not saved in rtcom but in `state.json` which is kinda like a cache14:20
dsc_its just contacts14:20
Wizzupdsc_: I do have questions about this14:45
Wizzupthe saving of the contact roster14:45
WizzupI think we have this in abook/eds, so I don't think we need to save it elsewhere14:45
dsc_you can think of it as "not being saved anywhere" :D14:57
dsc_the reason I put them in cache is because14:59
dsc_when you go online14:59
dsc_you get a roster14:59
dsc_so you may get 500 new entries in the overview14:59
dsc_and pushes the normal stuff down15:00
dsc_each time15:00
WizzupI don't really understand this, but I suspect when I start looking at it I will15:00
dsc_when its in cache, its attached to a date15:00
dsc_so the overview doesnt get spammed15:00
Wizzupthe contacts roster should be entirely tp/eds managed, and we just query it when we need it15:00
dsc_well you are replying while I didnt even finish explaining15:00
dsc_re-read what I said15:01
WizzupI did read it, I don't understand how contact lists/rosters affect the chats overview15:01
dsc_contacts show up in the overview15:01
Wizzupwait, since when?15:01
dsc_since every chat application does?15:02
dsc_https://plak.infrapuin.nl/selif/s5lqdemv.png15:02
Wizzupwe have the Contacts application for this15:02
Wizzupbut what we lacked was handling of invites and adding contacts/buddies, so that's good to have, but I don't think we need an additional contacts overview15:04
dsc_https://plak.infrapuin.nl/selif/823mkq66.png15:05
dsc_they show as messages (empty)15:05
dsc_but ehh15:06
dsc_ill check if its possible15:09
dsc_because.........15:11
dsc_I need to open channels to these contacts to do any kind of presence stuff15:12
dsc_but ill verify that15:12
dsc_e.g I cannot receive an invitation if I didnt instance a contact15:13
dsc_instancing a contact creates an entry, etc.15:13
dsc_"receiving an invitation" is one of the many "states" a presence publication can be in15:16
dsc_presence publication request*15:17
dsc_but yeah ill check...15:17
sicelo16:02 < dsc_> since every chat application does?  <<--- gajim and friends, yes, because there's no specialized contact management application. but on 'integrated' systems, e.g. even android, then yes, as Wizzup says, contact management is in contact application15:17
sicelodsc_: nice work btw15:20
dsc_sicelo: yeah, true. but imo maybe not comparable as conversations is not managing the contacts (well, only accepting friend requests), its just caching stuff for display/UX purposes15:21
dsc_but I do agree that, if there is a dedicated addressbook, the contacts should be shown there15:21
dsc_so I shall remove the automatic filling from conversations15:25
Wizzup15:13 < dsc_> e.g I cannot receive an invitation if I didnt instance a contact15:32
Wizzupyes, that we'll have to do for sure15:32
dsc_sure15:33
freemangordonyou can get contact list from abook15:35
freemangordonno need to manage you own addressbook15:35
freemangordonjut tell me what exactly do you need15:36
freemangordonand I'll provide you the code15:36
freemangordonbut, as Wizzup said, rosters etc are matter of eds/tp/abook15:37
dsc_Telepathy has Tp::ContactManager for the roster15:37
freemangordonlemme check it15:37
dsc_by asking for contacts, you can check if there are pending invites15:37
dsc_if this logic is on the addressbook side, then addressbook needs to signal such invites to me somehow15:37
freemangordongimme a minute to check what this class is doing15:38
dsc_so this is why I think conversations needs to implement the ContactManager15:38
dsc_ok15:38
dsc_next to invites, there's also presence "user is away"15:39
freemangordonso, why do you need from a contact?15:40
freemangordons/why/what15:40
dsc_management of buddy list (allow/reject/block/remove), status (online/away), status message15:41
dsc_I have this currently15:41
dsc_we can move it to addressbook15:41
freemangordononline status is already implemented in abook15:41
dsc_sure, abook is just another tp client15:42
freemangordonno15:42
freemangordonit is not "just another tp client"15:42
dsc_?15:43
freemangordonas it integrates eds with tp (and few more things)15:43
freemangordonevolution data server15:43
freemangordonwith telepathy15:43
dsc_which does what?15:43
freemangordonEDS is contacts (system addressbook)15:43
freemangordontelepathy is presence/rosters15:44
dsc_yes?15:44
dsc_so it listens to Tp15:44
freemangordonI am not sure how is contact blocking done in fremantle15:44
freemangordonsure15:44
dsc_conversations and abook are both tp clients, now we can move some logic to abook but this is a architecture decision15:44
freemangordonbut, it already provides interfaces/classes like avatar and contact online status15:45
freemangordonno, no, it is not that simple15:45
dsc_in theory they can both listen to presence for example15:45
freemangordonwait15:45
freemangordonroster contact can be attached to master contact15:45
dsc_right15:46
dsc_ok15:46
freemangordonso, your GF (lets call it Lara) has master contact in addressbook, with few IM accounts connected to it15:46
dsc_i have no gf 😭15:46
freemangordonboyfriend the, does not matter :p15:46
freemangordon*then15:46
dsc_LOL15:47
dsc_yeah but I get it15:47
freemangordonso, when you receive a message from iamlara@jabber.com, you don't want to show her name/nick on jabbaer.com, but the name that's on master contact in addressbook15:47
freemangordonyou can't do that with TP15:48
dsc_ok15:49
freemangordonyou must use   OssoABookContact15:49
dsc_ #include <libosso-abook/osso-abook.h>15:49
dsc_ok15:49
freemangordonwait15:49
freemangordonlook at https://github.com/maemo-leste/osso-abook/blob/master/lib/osso-abook-aggregator.h15:52
dsc_what version of Perl is this?15:52
freemangordonperl?15:52
dsc_sorry ill stop trolling15:52
dsc_so ok15:53
dsc_I can ask for status, online15:53
dsc_thats fine15:53
dsc_but the invites15:53
dsc_this would be handled by conversations, yes?15:53
freemangordonremote invites?15:53
freemangordonand auth requests?15:53
dsc_in XMPP the correct term is "presence subscriptions"15:53
dsc_they are bi-directional15:54
freemangordonmhm15:54
dsc_"user X has asked to see your status"15:54
dsc_its basically a "buddy invite"15:54
freemangordonso yes, I think conversations should handle that15:54
freemangordonWizzup: ^^^ correct?15:54
siceloit's handled by Contacts iirc15:54
freemangordonI am not sure15:54
WizzupI don't think it is handled by contacts in fremantle15:54
freemangordonright, I think it is handled by conversations15:55
Wizzupmy vote would be to handle it in conversations, but fmg and I also discussed whether that should be its own standalone program (I think not for now due to lack of work involved and further complexity)15:55
siceloi haven't played with this stuff recently on fremantle, but iirc it was Contacts, so that when you accept, a contact is saved15:55
Wizzupif it was handled by contacts I think it would work now :P15:55
freemangordonsaving a contact might be a side-effect15:55
freemangordonsicelo: I don;t remember seeing anything "invite" related in abook/addressbook code15:56
dsc_I ask this, because in order to receive such invites, I need to implement the ContactManager15:56
dsc_which means maintaining a roster15:57
dsc_and it sounds like abook is already doing that anyway15:57
freemangordonI still don;t get it why you need a roster15:57
freemangordonlike, what this roster is used for?15:58
freemangordonosso_abook_aggregator_find_contacts_for_im_contact() should do some job I guess15:59
freemangordonalso, there is OssoABookRosterManager15:59
dsc_so I would iterate this OssoABookROster16:00
dsc_to check for invites16:00
freemangordonwhat for?16:00
freemangordonwait, there is no signal?16:00
dsc_how does conversations know that there is an invite?16:00
freemangordonthere must be dbus signal16:00
freemangordonlemme check tp specs16:00
dsc_wait16:00
dsc_if conversations is open, and listening to such signals, then yes16:01
dsc_if droid4 is powered off16:01
dsc_and someone sends you an invite16:01
dsc_then there is no signal16:01
dsc_so then you iterate the roster16:01
dsc_and check for the invite16:01
dsc_when you go online16:01
freemangordonso, server does not queue those?16:01
freemangordonI don't believe that :)16:01
dsc_sorry it does16:02
dsc_its just that it doesnt send it multiple times16:02
dsc_so you cannot rely on signal alone16:02
freemangordonif you are offline, whom it is send the first time?16:02
dsc_when you go line, you'll receive it. Then you poweroff droid4, go back online, the server wont send this invite16:03
dsc_online*16:03
freemangordonsure, but you receive it at least once16:03
dsc_yes16:03
freemangordonso, it is a matter of storing that somehow16:03
dsc_no16:03
freemangordonwhy?16:04
dsc_because the remote can decline that invite in the meantime16:04
dsc_or remove it16:04
dsc_remote is source of truth16:04
freemangordonbut you'll receive a signal for that too,no?16:04
freemangordonalso, how is that different to :16:04
dsc_hmm16:04
freemangordonyou receive a signal for invite and while navigating through the iface this invite is removed16:05
dsc_what about multiple clients :)16:05
freemangordonah, you mean if you decline on another device16:05
dsc_yes, this is why it cannot be stored, I think16:05
dsc_but I would assume abook already has such logic, no?16:06
freemangordonbut ok, if you have multiple devices, then what? all of them receive the signal, no?16:06
freemangordonabook has nothing to do with invites16:06
dsc_abook maintains a roster16:06
dsc_eh, it asks for a roster16:06
freemangordonno, server maintains a roster16:07
freemangordonyeah16:07
dsc_yes :P16:07
freemangordonactually it is not abook16:07
freemangordonbut eds plugin16:07
dsc_and within this roster, contacts have a "publication status"16:07
freemangordonthat creates EBook16:07
freemangordonno16:07
freemangordonbut we can add, if needed16:07
dsc_i dont know if abook does this, yeah16:07
freemangordonsec, lemme check something16:08
dsc_for example, with XMPP you cannot see someone's online status without a friend request16:08
freemangordonyeah, we have it16:08
dsc_you have to accept eachothers status publication request16:08
dsc_ok16:08
freemangordonsee https://github.com/maemo-leste/osso-abook/blob/master/lib/osso-abook-contact.h#L8716:09
freemangordon"X-TELEPATHY-BLOCKED", "X-TELEPATHY-SUBSCRIBED", "X-TELEPATHY-PUBLISHED"16:09
dsc_yes16:09
dsc_thats it16:09
freemangordonsec, to see how are those mapped16:10
freemangordonsee https://github.com/maemo-leste/eds-backend-telepathy/blob/master/src/e-book-backend-tp-contact.c#L20916:11
freemangordonhmm, I don;t see eds plugin setting those16:13
freemangordonperhaps I just don;t see it, lemme dig deeper16:15
dsc_so from osso I will need16:15
dsc_these friend requests16:16
dsc_per Tp account16:16
dsc_and you're saying I can iterate contacts through the osso API16:17
dsc_which will give me those statuses16:17
dsc_yeah its fine by me16:17
freemangordonyeah, according to the theory16:18
freemangordonperhaps you already have the requests as well16:18
freemangordonbut I am checking what data is attached16:18
freemangordonok, I guess the magic happens here https://github.com/maemo-leste/eds-backend-telepathy/blob/master/src/e-book-backend-tp-cl.c#L69116:21
dsc_yes, I think it has this logic for pending, etc.16:23
freemangordonmhm16:23
freemangordonbut, should do some tests to see how it appears in the vcard16:23
dsc_this is very similar to my C++ for contactChanged16:23
freemangordonsure, qt api is just a wrapper on top of glib16:24
freemangordonglib api that is16:24
freemangordonthis is Perl 3.1716:24
freemangordonlemme chek how tp-glib reports invites16:25
freemangordondsc_: what about https://telepathy.freedesktop.org/doc/telepathy-glib-0.24.x/telepathy-glib-contact.html#TpContact--publish-request?16:26
freemangordondoes it look familiar?16:26
dsc_yes16:26
freemangordonok, lemme see if eds plugin cares about that16:27
dsc_that's fine16:27
dsc_as long as I can get these properties16:27
freemangordonif it is missing, I can easily add it16:28
freemangordonno need to duplicate code16:28
freemangordonbut will need some time to see what happens16:29
freemangordondsc_: hmm, you know what? you get tp handle from abook rosters list16:30
freemangordonso I think you can create contact from that handle and ask it whatever you want16:31
dsc_ah thats nice16:31
freemangordonlemme check the api16:31
freemangordonoh16:33
freemangordonosso_abook_contact_get_blocked() :)16:34
dsc_can_block, can_request_auth, reject_for_uid16:35
dsc_so that looks OK16:36
freemangordonyeah, looks like that;s itr16:36
freemangordonnot sure that works though16:36
freemangordonin leste that is :)16:36
freemangordonnever been used16:36
dsc_yes16:36
dsc_but I rather have this in abook16:36
freemangordonright16:37
dsc_because for me its much easier to use this API16:37
freemangordonsure16:37
freemangordonthat's the point :)16:37
freemangordondespite being C16:37
dsc_I have implemented in c++ right now16:38
dsc_i was about to make a PR16:38
freemangordona pity16:38
dsc_doesnt matter16:38
dsc_well16:38
dsc_i lost 10 days16:38
freemangordonyeah, that's why "a pity"16:38
freemangordonok, I a running out of time now (guests are coming), will ping you tomorrow to see what exactly do you need in terms of functions etc16:40
dsc_alright16:40
dsc_thanks16:40
freemangordonmight even create a test qt app that calls abook16:40
freemangordonand gives you the status of app contacts in an account16:40
dsc_in the meantime ill try some things16:41
freemangordonok, see test applications in abook16:41
freemangordonlike this https://github.com/maemo-leste/osso-abook/blob/master/lib/test-contact-chooser.c16:41
freemangordonkeep in mind aggregator/roster/etc are of type OssoABookWaitable16:43
freemangordonsee https://github.com/maemo-leste/osso-abook/blob/master/lib/osso-abook-waitable.h16:43
freemangordonyou will need osso_abook_waitable_call_when_ready() most probably16:43
dsc_does this influence the Qt eventloop?16:48
freemangordonqt evenloop uses GMainLoop on linux :)16:53
freemangordonso you should not do anything special (in theory)16:53
dsc_alright16:53
arno11finally i'm not sure if a web browser is so important on N900 in 2024...with chatgpt-4 working fine on it and able (for example) to write/build its own gtk UI for my device. another world23:35
arno11i think we can make funny/crazy things with it on Leste23:37
arno11for example, if we grep most important things from irc logs + things from the user guide, then the AI could easely become a 'Leste virtual customer tech support agent' from conversations (just an idea)23:45

Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!