libera/#maemo-leste/ Tuesday, 2024-11-12

siceloarno11: and anyone interested in solving N900/omap3 power management issues - hope some of what Andreas is working on here, https://marc.info/?l=linux-omap&m=173136502302181&w=2, can be directly applicable. i seem to recall that SPI  was also our worst offender04:53
sicelohttps://github.com/maemo-leste/bugtracker/issues/545#issuecomment-98045878404:53
Wizzupthe main issues I am finding these days is that sometimes the modem drops from the usb bus and leste doesn't make this obvious to the user: things keep working and it will even still show the signal bar10:41
WizzupI suppose the connui-cellular rework might fix this10:41
arno11sicelo: sounds promising14:20
arno11Wizzup: is it only on d4 or on all devices ?14:22
Wizzupprobably all, but the modem doesn't disappear as frequently on n90014:25
Wizzupit happens maybe once every few weeks14:25
WizzupI am pretty sure fmg's work will at least make us aware of this problem14:25
arno11ok14:27
dsc_freemangordon: hi15:56
dsc_looking for a sgianl related to contacts changing attributes like presence, I think its contactChanged or some such15:57
arno11Wizzup: btw most of the time when i lock the screen now, hsdpa connection is lost16:20
arno11previously i was able to keep the connection for hours, even days16:21
Wizzupwow, what :D16:24
arno11*even days with a charger ofc16:28
arno11i wonder what happened recently16:30
freemangordondsc_: is that related to abook?16:55
freemangordonWizzup: re connui-cell - finally I am back on it since Sunday16:55
freemangordonmaking steady progress, hopefully will hit -devel by the end of the week16:56
dsc_freemangordon: looking for a way to track changes to contacts, since contacts are managed by abook, I suspect there may be a signal there somewhere16:59
dsc_to detect incoming friend requests for example17:00
freemangordondsc_: see https://github.com/maemo-leste/osso-abook/blob/master/lib/osso-abook-contact.c#L11517:03
freemangordonG_IMPLEMENT_INTERFACE() means inheritance, in c++ terms17:03
freemangordonso, OssoABookContact is also OssoABookPresence17:04
dsc_hmm17:04
freemangordonalso, OssoABookContact does https://github.com/maemo-leste/osso-abook/blob/master/lib/osso-abook-contact.c#L201 for all properties changed17:06
dsc_ok ill try something17:06
dsc_yes :) thats what I noticed just now17:07
freemangordonso you should connect to "notify::presence-status"17:07
freemangordonconnecting to "notify::" is a bit tricky17:07
freemangordoncallback must have signature:17:08
freemangordonvoid (*cb)(GObject *gobject, GParamSpec *pspec, gpointer user_data)17:08
dsc_yes, i was looking at what is user_data17:10
dsc_but ill figure it out thanks17:10
freemangordonsec, will provide an example17:10
freemangordonsee https://github.com/maemo-leste/osso-abook/blob/master/lib/osso-abook-button.c#L96917:11
freemangordonuser_data is the data you want to be passed to callback17:12
dsc_oh.17:12
freemangordonusually pointer to structure, but can pass this if callback is static member17:12
dsc_ok that work will work fine17:15
dsc_ok that will work fine*17:15
dsc_the roster code from yesterday also works17:15
dsc_freemangordon: this snprintf is annoying https://plak.infrapuin.nl/selif/je57ex3q.txt17:16
freemangordondon't use snprintf17:17
freemangordonsee https://docs.gtk.org/glib/func.strdup_printf.html17:18
dsc_alright17:18
freemangordonalso, no need to do e_vcard_get_attribute17:18
freemangordonyou can directly do osso_abook_contact_get_blocked(contact), for example17:19
freemangordonor   osso_abook_contact_get_value()17:20
dsc_its probably neccesary for values that are not binary17:20
dsc_ah ok17:20
freemangordonyou do osso_abook_contact_get_value(E_CONTACT(contact);17:20
freemangordonE_CONTACT(contact) casts from OssoABookContact to EContact17:21
freemangordonagain, see https://github.com/maemo-leste/osso-abook/blob/master/lib/osso-abook-contact.c#L11517:21
freemangordonimplementing E_TYPE_CONTACT means that it inherits EContact17:22
freemangordonthe same for the other interfaces/classes in the list17:22
freemangordonso you can safely do OSSO_ABOOK_AVATAR(contact) etc17:23
freemangordonand call functions in https://github.com/maemo-leste/osso-abook/blob/master/lib/osso-abook-avatar.h17:23
dsc_alright17:23
dsc_one question17:23
freemangordonkeep in mind that you should get avatar of master contact, not roster contact17:23
freemangordon?17:24
dsc_should I be storing a list of contacts17:24
dsc_in conversations17:24
freemangordonno17:24
dsc_I reckon no17:24
freemangordonyou can always retreive them from abook17:24
dsc_i was wondering because we are connecting to callbacks and idk what happens when we g_list_free(contacts)17:25
freemangordonanyways it is storing all the contacts *and* their relations etc17:25
freemangordonall you see in addressbook application (and things you don't see) are at your disposal17:25
freemangordonno need to waste your time duplicating code17:25
dsc_well17:26
freemangordonalso, if you need some functionality and you can;t find it, please, first check with me if it is not already in abook17:26
freemangordonas it does lots of things17:26
freemangordonlike, you can use OssoABookContact (or some other class) directly as clickable avatar that opens the contact details/actions17:28
freemangordong_list_free() frees the list, not the data it contains17:29
freemangordonhowever, you shoudl g_object_ref(contact) if you want to be sure it would not disappear under your feet17:29
dsc_ok, dont think it will be a problem17:30
freemangordondo not forget to unref once you don;t need it anymore17:30
freemangordonalso, you must explicitly disconnect from signals you connected to when you don;t need the object anymore17:31
freemangordona note: osso_abook_contact_get_uid() gets EBook contact uid17:32
dsc_sure17:32
dsc_i would have noticed that eventually hehe17:32
freemangordonsorry, I meant master contact uid17:33
dsc_yes17:33
freemangordonIIUC17:33
freemangordonok17:33
dsc_ill look at this notify::presence-status17:33
dsc_which applies to a OssoABookContact17:34
freemangordonmhm17:34
dsc_or not?17:34
freemangordonyes, it does17:34
dsc_ok17:35
dsc_thanks17:35
freemangordonsee https://github.com/maemo-leste/osso-abook/blob/master/lib/osso-abook-contact.c#L85417:35
dsc_actually17:35
dsc_sorry I need more coffee17:36
dsc_I'm looking for publication requests17:36
dsc_hmm17:36
* freemangordon hands dsc_ a cup of coffee17:36
dsc_presence-status might be something else17:36
dsc_but maybe its enough17:36
dsc_let me check17:36
freemangordonyeah, it is something else17:37
freemangordonlemme find what you need17:37
freemangordondsc_: seems abook does not provide signals when published/blocked/etc has changed17:45
freemangordonbut, you said TP already provides those signals?17:46
freemangordonlemme double-check17:47
dsc_signals in TP are: subscriptionStateChanged, publishStateChanged, blockStatusChanged17:47
dsc_these are Tp::Contact signals17:48
freemangordondo you need those connected for all contacts?17:48
dsc_yes17:49
dsc_but only if the connection manager has those capabilities17:49
freemangordonosso_abook_contact_presence_get_handle() will give you TP handle17:50
dsc_ah ok17:50
freemangordonwait, wrong function17:51
dsc_maybe there is a classmethod Tp::Contact::fromHandle()17:51
freemangordonosso_abook_presence_get_handle()17:51
freemangordonexactly17:51
dsc_so if abook destroys a contact, I also need to know, I think17:54
dsc_because I'm operating on it from tp-qt17:54
freemangordonif you ref it, it will not destroy it17:54
dsc_ah ok17:54
freemangordonbut yeah, you should be notified17:55
freemangordondon;t ask me how though :), have to llok in the code17:55
freemangordon*look17:55
freemangordonok, at least tp-glib has https://telepathy.freedesktop.org/doc/telepathy-glib/telepathy-glib-simple-client-factory.html#tp-simple-client-factory-ensure-contact17:56
dsc_ContactPtr ContactManager::ensureContact(uint bareHandle, const QString &id, const Features &features)17:57
dsc_it seems to lookup this handle in some private dict17:58
dsc_so dont think this is it17:59
freemangordonlink?18:00
dsc_https://github.com/TelepathyIM/telepathy-qt/blob/master/TelepathyQt/contact-manager.cpp#L144118:01
dsc_https://github.com/TelepathyIM/telepathy-qt/blob/master/TelepathyQt/contact-manager.cpp#L145718:01
dsc_well, this is contactManager18:01
freemangordonhttps://github.com/TelepathyIM/telepathy-qt/blob/master/TelepathyQt/contact-manager.cpp#L144818:01
dsc_:)18:02
freemangordonif it does not find it, it calls connection manager18:02
dsc_alright18:03
dsc_ill try18:03
freemangordonsee https://telepathy.freedesktop.org/doc/telepathy-qt/a08188.html18:04
freemangordonso, I think once you use the handle, you no more need abook contacts18:04
freemangordonbut, my gut feeling tells me there must be a better way of watching for contacts changes18:05
freemangordoninstead of keeping all the contacts in the system18:06
dsc_my gut feeling is "freemangordon will implement subscriptionStateChanged, publishStateChanged, blockStatusChanged in abook :D"18:06
freemangordonno, TP should already provide that for you18:07
freemangordontp_cli_connection_interface_contact_info_connect_to_contact_info_changed18:07
dsc_just like abook has presence-status18:07
freemangordonhttps://telepathy.freedesktop.org/doc/telepathy-glib-0.24.x/telepathy-glib-connection-contact-info.html#tp-cli-connection-interface-contact-info-connect-to-contact-info-changed18:07
dsc_uhmmm18:09
dsc_yes that can work18:09
freemangordonthats what eds TP plugin uses18:10
freemangordonyou just need to find Qt equivalent18:10
freemangordonbtw, there is Tp::ContactManager::contactsForHandles()18:13
dsc_its a bit annoying18:14
dsc_lemme make a suggestion18:15
dsc_https://github.com/maemo-leste/osso-abook/blob/1a52f8f650d566a0cd8ced10582178348feae808/lib/osso-abook-contact.c#L478-L48318:15
dsc_we add 2 conditions here for PUBLICATION and SUBSCRIPTION18:15
dsc_so we can do18:15
dsc_osso_abook_contact_notify(contact, "publication-status");18:15
dsc_at which point we have `notify::publication-status`18:16
freemangordonno, thats suboptimal18:16
freemangordonbecause you should get notified when contact changes and see what has changed18:17
freemangordonwithout keeping all the contacts around18:17
freemangordonwhat if contact appears or gets deleted? who will refresh your list?18:17
dsc_abook should give me signals for new or removed contacts, no?18:19
dsc_since abook manages all the contacts18:19
dsc_basically, we're using abook where we would otherwise use tp-qt's contactManager18:19
freemangordonhttps://telepathy.freedesktop.org/doc/telepathy-qt/a09344.html18:22
freemangordonbut yeah, I may consider adding that to abook18:22
dsc_ok, lets think about it for a bit18:23
freemangordonBTW, did you check those 2 are properly set in vcard?18:25
dsc_yes it works18:25
freemangordongreat18:25
freemangordonok, I will add those18:25
freemangordonwill take me a while though18:25
dsc_ehh18:25
freemangordonhmm?18:26
dsc_sorry I lied, let me check18:26
dsc_i checked the presence attribute18:26
freemangordonsee https://github.com/maemo-leste/osso-abook/blob/1a52f8f650d566a0cd8ced10582178348feae808/lib/osso-abook-debug.c18:27
freemangordonhmm abook should already notify on contact update18:27
freemangordonand then you can just ask for blocked etc18:28
freemangordondsc_:  OssoABookAggregator18:29
dsc_< freemangordon> BTW, did you check those 2 are properly set in vcard? <== they work, I checked18:30
freemangordoncool18:30
dsc_freemangordon: what about OssoABookAggregator?18:30
freemangordonit provides contacts added/removed/changed signals18:30
freemangordonso, you can connect to those and check whatever needed as you receive them18:31
freemangordoninstead of keeping contacts list18:31
dsc_great18:31
freemangordonhttps://github.com/maemo-leste/osso-abook/blob/master/lib/osso-abook-roster.c#L63018:34
freemangordonoops18:34
freemangordonnot that one18:34
freemangordonthis: https://github.com/maemo-leste/osso-abook/blob/master/lib/osso-abook-roster.c#L42418:35
dsc_ok, ill try18:35
freemangordonhttps://github.com/maemo-leste/osso-abook/blob/master/lib/osso-abook-roster.h#L5518:36
freemangordonall callbacks have one more parameter (gpointer user_data)18:36
freemangordonso your contacts_changed cb should look like 'void contacts_changed_cb(OssoABookRoster   *roster, OssoABookContact **contacts, gpointer user_data);'18:37
dsc_freemangordon: https://plak.infrapuin.nl/selif/9ifpdr2s.txt19:54
dsc_this does not trigger with for example presence changes (switching a contact from online to away)19:55
dsc_I keep the roster/aggregator objects around, so thats not it19:57
dsc_https://github.com/maemo-leste/osso-abook/blob/master/lib/osso-abook-roster.c#L63019:59
dsc_this is on an EBook*19:59
dsc_maybe I should do that?19:59
dsc_or EBookView* rather20:00
freemangordonyes, it should not get triggered for presence changes20:01
freemangordonas those come from telepathy, not as evcard20:01
freemangordonsee if those get triggered for some vcard property change20:02
freemangordonlike, change remote nick20:02
freemangordonor name, or whatever20:02
dsc_I changed my avatar to a cute rabbit, it did not trigger the callback20:05
dsc_name change (I think this is 'alias') also did not trigger it20:05
freemangordonyour avatar?20:10
dsc_profile picture20:10
freemangordonyes, I know what avatar is, the question is - what contact is that?20:11
freemangordonremote one?20:11
dsc_yes20:11
dsc_both contacts are already "friends"20:11
freemangordonplease repeat with OSSO_ABOOK_DEBUG=all20:11
freemangordonand provide logs20:12
freemangordonG_MESSAGES_DEBUG=all OSSO_ABOOK_DEBUG=all20:13
freemangordondsc_: what account is that? irc?20:15
dsc_hmm ok sorry, it works now20:18
dsc_not sure what happened20:18
freemangordonheh :)20:18
dsc_ok cool20:18
dsc_next up we have: accepting/denying friend requests20:20
dsc_maybe relevant: https://github.com/maemo-leste/osso-abook/blob/1a52f8f650d566a0cd8ced10582178348feae808/lib/osso-abook-aggregator.c#L13620:20
freemangordonno20:21
freemangordonyou can't do that from abook20:21
freemangordonthis shall be done by TP20:21
dsc_alright, that's fine20:22
dsc_bbl, thanks20:22
siceloWizzup: modem disappearing ... yes I've reported it before on D4. not yet seen it on N90021:03
sicelowe need to check carefully how we react to ModemRemoved and similar signals.21:04
siceloalthough I haven't experienced it on D4 in the last few weeks21:04
freemangordonsicelo: this is properly handled in the new connui-cell21:04
sicelooh sweet21:05
sicelosneak preview? :-)21:05
freemangordonno, sorry21:06
freemangordonby the end of the week21:06
sicelosure21:06

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