jrayhawk_ has joined #maemo-leste
jrayhawk_ has quit [Client Quit]
Enviosity has quit [Quit: Connection error?!]
Enviosity has joined #maemo-leste
Anasko has quit [Remote host closed the connection]
Anasko has joined #maemo-leste
Enviosity_ has joined #maemo-leste
Enviosity has quit [Ping timeout: 252 seconds]
System_Error has quit [Remote host closed the connection]
akossh has quit [Remote host closed the connection]
akossh has joined #maemo-leste
System_Error has joined #maemo-leste
joerg has quit [Ping timeout: 252 seconds]
joerg has joined #maemo-leste
<dsc_> freemangordon: morn
<freemangordon> hi!
Livio has joined #maemo-leste
ceene has joined #maemo-leste
<dsc_> I implemented online status in overview: https://plak.infrapuin.nl/selif/nw3f3583.png
<dsc_> works alright
<freemangordon> using abook widgets?
<dsc_> using abook contact changed signals
<dsc_> presence changed*
<freemangordon> you re-implemented abook contacts list?
<freemangordon> or that's different
<dsc_> this is the conversations chat message overview, not the contact list
<freemangordon> yeah, I see
<freemangordon> the point is - do you draw avatar and presence status by yourself?
<dsc_> yes :)
<freemangordon> dsc_: ok, great job
<dsc_> if(presence == "available") display(available_icon_thing) :P
<dsc_> we can use gtk widgets if they exist I dont care
<dsc_> but i will need help
<freemangordon> I think they exists
<freemangordon> and they will draw the avatar for you as well :)
<dsc_> that would be nice
<freemangordon> but have to check how exactly
<dsc_> this status thing should work for all connection managers that implement the SimplePresence feature
<dsc_> i check for it
<freemangordon> yeah
<dsc_> and sending friend requests is only enabled when the CM has TP_QT_IFACE_CONNECTION_INTERFACE_CONTACTS
<freemangordon> but, which exactly presence do you show? aggregate presence?
<dsc_> ? :P
<freemangordon> heh :p
<dsc_> thats up to the server
<dsc_> right?
<freemangordon> no, wait
<dsc_> you cant set your status in conversations
<freemangordon> ok, as we discussed, each contact has at least one master (that can be temp) and zero or more roster contacts
<dsc_> this is done via maemo
<dsc_> ah
<freemangordon> so, aggregate presence is that 'best' presence from all the roster contacts
<freemangordon> so, if you are online on facebook but offline on jabber, the aggregate presence is online
<freemangordon> do you get the point?
<dsc_> yes im just looking at the code currently
<freemangordon> which code?
<freemangordon> abook?
<dsc_> OssoABookContact *contact = static_cast<OssoABookContact *>(l->data);
<dsc_> EContact* e_contact = E_CONTACT(contact);
<dsc_> const char* presence = osso_abook_contact_get_value(e_contact, OSSO_ABOOK_VCA_TELEPATHY_PRESENCE);
<dsc_> does this use the master contact
<dsc_> ?
<dsc_> probably not
<dsc_> or ehh
<dsc_> no idea.
<freemangordon> you should use osso_abook_presence_get_presence_status(OSSO_ABOOK_PRESENCE(contact)) anyways
<freemangordon> but lemme check what presence it gets
<dsc_> im asking for OSSO_ABOOK_VCA_TELEPATHY_PRESENCE
<dsc_> which sounds specific
<dsc_> so its probably not the aggregate
<freemangordon> mhm
<freemangordon> you can do osso_abook_presence_get_icon_name on the contact
<freemangordon> and if you provide master contact, you will get aggregate presence
<freemangordon> if you provide roster contact, then you will get that particular connection presence
<dsc_> cool, ill try the icon
<freemangordon> which you can use directly (as GtkWidget ofc) to show the avatar
<freemangordon> oops, sorry
<dsc_> get_pixbuf 😎
Anasko has quit [Remote host closed the connection]
Anasko has joined #maemo-leste
<freemangordon> OssoABookContact implements OssoABookAvatar which can be provided to http://maemo.org/api_refs/5.0/5.0-final/libosso-abook/OssoABookAvatarImage.html
<freemangordon> it is easy to show GtkWidget in qt app
<dsc_> yes I am looking at some code
<dsc_> it creates a x11 window?
<freemangordon> umm... no, there was an easier way
<freemangordon> lemme check
<freemangordon> no QX11EmbedContainer
<freemangordon> you can get qt window native id and wrap it to some gtk window, sec
<dsc_> sounds a bit crazy :d
<dsc_> wrap conversations in a gtk window?
<dsc_> k
<dsc_> no idea whats going on there
<dsc_> will have to see later
<freemangordon> you get XID (effectiveWinId()) from qt and pass it to gdk_window_foreign_new()
<freemangordon> and you have GdkWindow you can add GtkWidget to
<freemangordon> simplified
<freemangordon> I can provide sample code later on
<dsc_> ok :)
<freemangordon> dsc_: I wonder if it is not a time to start implementing 'start chat' functionality, I can provide a simple qt application that does it(the selection part). what do you think?
<dsc_> freemangordon: yes, would be nice. it needs to happen from addressbook somehow
<freemangordon> mhm
<dsc_> what do you have in mind?
<freemangordon> oh, wait
<freemangordon> I mean - there is 'new message' in the menu
<dsc_> yes, I changed it in my current dev branch, but I figure it will be removed because we wil be doing it from abook
<freemangordon> I think pressing that shall open abook contact searcher
<dsc_> yes something like this
<freemangordon> no, we already can do from abook
<freemangordon> but my understanding is that we shall be able to start new chat from conversations, no?
<dsc_> yes correct
<dsc_> need a contact picker
<freemangordon> exactly
<dsc_> if you can spawn this gtk widget/dialog somehow
<freemangordon> so, my plan is to provide a simple application that implements contact picker in qt
<dsc_> yes
<freemangordon> yes, I can
<dsc_> and get the results from it
<freemangordon> mhm
<dsc_> abook is aware of the protocols right?
<freemangordon> you will get OssoABookContact, when you select one, IIRC
<freemangordon> sure
<freemangordon> half of the code deals with TP
<dsc_> yes
<freemangordon> ok, cool
<dsc_> let me check @ OssoABookContact,
<freemangordon> I'll do it as soon as I have some spare time
<freemangordon> check what? you already use it :)
<freemangordon> you will get roster contact
<dsc_> yes but
<freemangordon> with remote id and such
<dsc_> need to map it to local_uid,remote_uid
<dsc_> there is osso_abook_contact_get_persistent_uid
<freemangordon> map? I think there will be no need to map
<dsc_> yes that function will work
<freemangordon> as you can get TpAccount (the local one) from a contact\
<dsc_> im already using it
<dsc_> or that, yeah
<dsc_> ok
<freemangordon> ok, we have a deal
<dsc_> xD
<freemangordon> btw, for the avatar
<freemangordon> I will also have to provide sample app
<dsc_> well
<freemangordon> but maybe lets do 'new message' first
<freemangordon> hm?
<dsc_> osso_abook_avatar_image_get_pixbuf
<dsc_> would be easier
<dsc_> no need to include the whole widget this way
<freemangordon> yeah, but that's GdkPixbuf
<dsc_> its just an image, no?
<dsc_> yes, I can get the pixeldata from it
<freemangordon> yes, but it will not update on-the-fly
<dsc_> I already listen to updates
<freemangordon> you have to connect to 'avatar-changed'
<freemangordon> right, but all this is already implmented
<dsc_> i think it would be easier
<freemangordon> no
<dsc_> no need for widget
<freemangordon> I think it will be way easier to just embed gtk widgets
<freemangordon> but lets see
<dsc_> maybe, the gtk window handle bla stuff seemed a bit convoluted
<dsc_> also I need to draw this in a table
<freemangordon> it is not gtk, but x11 handle
Livio has quit [Ping timeout: 260 seconds]
<freemangordon> XID
<freemangordon> or 'Window'
<dsc_> btw
<dsc_> I also need to draw this in QML, possibly
<dsc_> for the chatwindow
<freemangordon> hmm, rigth
<dsc_> only the overview is qtwidgets
<freemangordon> ok, we can cheat then
<dsc_> there I will need an image
<freemangordon> yeah
<dsc_> its possible to create a custom QML component and override the paint method
<dsc_> but...
<dsc_> hmm
<freemangordon> /home/user/.osso-abook/avatars
<freemangordon> those are the tokens in question
<dsc_> nice
<freemangordon> but, you will have to connect to 'avatar-changed' and re-load whenever needed
<dsc_> yes I can see the avatars in that directory
<dsc_> ok
<freemangordon> yeah, this is where abook storest them
<dsc_> i will write this code now
<freemangordon> hmm, wait
<freemangordon> it is not that simple
<freemangordon> I think abook does some magic to keep the avatars aspect ration sane
<freemangordon> lemme check
<freemangordon> yeah, OssoABookAvatarImage provides fallback image as well
Anasko has quit [Remote host closed the connection]
Anasko has joined #maemo-leste
<freemangordon> dsc_: btw, QML has native window id too
<freemangordon> but if we draw widget on it, I think we will ruin the performance
pere has quit [Ping timeout: 244 seconds]
<freemangordon> as it will have to do ReadPixels
MinceR has quit [Ping timeout: 272 seconds]
<dsc_> how do you draw widget on QML though
<dsc_> it has scrolling etc
<freemangordon> no, I mean if we try to embed GtkWidget in it
<freemangordon> it will be bad perf wise
<freemangordon> as gtk does SW render
<freemangordon> while qml does GPU
<freemangordon> afaik
<dsc_> yes
<freemangordon> so, for SW render, we have to issue glReadPixels
<dsc_> im not following how that would work
<dsc_> there is a QML surface
<freemangordon> it will, but will be slow
<freemangordon> so scratch it
<dsc_> ok
<freemangordon> lets just use images from the filesystem
<freemangordon> it scales and clips and draws shadow and whatnot :)
<freemangordon> but I guess we can live without those
<dsc_> i also get contact changed signal from changing the avatar
<dsc_> dont think I need avatar-changed
<freemangordon> you need
<freemangordon> because you might have more than one avatar per master contact
<dsc_> alright
<dsc_> so this signal
<dsc_> OssoABookContact *contact = *contacts;
<dsc_> its on this?
<dsc_> i dont think so
<dsc_> because it didnt work :P
<freemangordon> no, it is on master contacts list
<freemangordon> from the aggregator
<dsc_> right
<dsc_> g_signal_connect(conv_abook_aggregator, "avatar-changed", G_CALLBACK(account_avatar_changed_cb), nullptr);
<dsc_> like that?
<dsc_> i dont know what emits the signal
<freemangordon> no
<dsc_> what object
<freemangordon> it is per contact
<dsc_> its in ./lib/osso-abook-self-contact.c
<freemangordon> osso_abook_aggregator_list_master_contacts
<freemangordon> no self contact is your vcard
<dsc_> ah
<freemangordon> or you can do osso_abook_aggregator_find_contacts_full and filter by whatever criteria
<freemangordon> basically home applet gives you example what shall be done for a single contact
<dsc_> ugh
<freemangordon> hmm?
<dsc_> nothing
<freemangordon> so yeah, you can either get pixels from GdkPixbuf or load the files by hand
<freemangordon> but, there is already some caching, so using osso_abook_avatar_get_image_scaled() might be faster
<freemangordon> it will also do the cropping for you
<freemangordon> so you will not need to reimplement all that logoc
<dsc_> aparantly I was using
<dsc_> GList *contacts = osso_abook_aggregator_list_roster_contacts(conv_abook_aggregator);
<dsc_> to get the contacts from abook
<dsc_> but I have the use the *master* list
<dsc_> so lets see how much stuff I have to change
<freemangordon> you can get master contact from roster contact
<freemangordon> wait
<freemangordon> umm, what do you need roster contacts for? 'contact-changed'?
<dsc_> const char* subscribed = osso_abook_contact_get_value(e_contact, OSSO_ABOOK_VCA_TELEPATHY_SUBSCRIBED);
<dsc_> const char* published = osso_abook_contact_get_value(e_contact, OSSO_ABOOK_VCA_TELEPATHY_PUBLISHED);
<dsc_> const char *persistent_uid = osso_abook_contact_get_persistent_uid(contact);
<dsc_> to ask for this stuff
<freemangordon> ok, so persistent_ui should be the uid of the master contact
<freemangordon> or, you can do osso_abook_contact_get_master_uids(roster_contact)
<freemangordon> but, IIRC, you get master contact too with contact-changed
<dsc_> this is not changed
<freemangordon> ah
<dsc_> onConnection
<freemangordon> I see
<dsc_> I ask for the roster
<freemangordon> ok, ok
<dsc_> :D
<dsc_> btw
<freemangordon> btw, do not use osso_abook_contact_get_value()
<freemangordon> osso_abook_presence_get_subscribed()
<freemangordon> and osso_abook_presence_get_published()
<dsc_> im using that in the contacts-changed callback
<dsc_> OssoABookPresence *abook_presence = OSSO_ABOOK_PRESENCE(l->data);
<dsc_> TpConnectionPresenceType presenceType = osso_abook_presence_get_presence_type(abook_presence);
<dsc_> etc.
<dsc_> but for the initial roster, not sure how to get this abook_presence
<dsc_> anyway
<dsc_> this is for later
<dsc_> im already happy it works currently
<freemangordon> OSSO_ABOOK_PRESENCE(contact)
<dsc_> cool
<dsc_> thx
<dsc_> wait it returns multiple
<freemangordon> sure
<dsc_> ok so
<freemangordon> you may have more that one master contact that includes "steve_jobs@whatever.jabber.com", no?
<dsc_> im trying to do avatar-changed
<dsc_> i need to get the master-contact
<dsc_> associated with the initial roster
<dsc_> and this master contact can be multiple?
<freemangordon> mhm
<freemangordon> just use the first one
<freemangordon> usually there will be only one
<dsc_> alright
<freemangordon> IIUC
<freemangordon> ok, have to run, ttyl
<dsc_> i will try this `osso_abook_aggregator_list_master_contacts`
MinceR has joined #maemo-leste
<freemangordon> dsc_: oh, wait
<freemangordon> you are showing last message, right?
<dsc_> yes
<dsc_> does this look OK?
<dsc_> GList *contacts = osso_abook_aggregator_list_master_contacts(conv_abook_aggregator);
<dsc_> for (GList *l = contacts; l != nullptr; l = l->next) { OssoABookContact *contact = static_cast<OssoABookContact *>(l->data); g_signal_connect(contact, "avatar-changed", G_CALLBACK(account_avatar_changed_cb), nullptr);
<dsc_> }lol
<dsc_> let me paste
<dsc_> because it doesnt work yet
<freemangordon> then isn't it better to use roster avatar related to the channe this message came from?
<dsc_> im just wondering
<dsc_> ah yeah
<dsc_> good idea
<freemangordon> mhm
<freemangordon> the same fot chat window
<freemangordon> *for
<freemangordon> so it is even simpler
<freemangordon> no need to deal with master contacts, sorry for the confusion
<freemangordon> and the same for presence
<freemangordon> I got confused :)
<dsc_> hmm
<dsc_> what do you mean "same for presence" ?
<dsc_> ah ok
<freemangordon> use roster presence, not master
<dsc_> so I should use `osso_abook_aggregator_list_roster_contacts`
<dsc_> ok
<dsc_> or well, I filter the contacts in that loop
<freemangordon> you already do, no?
<dsc_> yes
<freemangordon> you can filter by using abook
<freemangordon> just provide filter function
<freemangordon> see a
<dsc_> filter on local_uid would be nice
<freemangordon> osso_abook_aggregator_find_contacts_full
<dsc_> OssoABookContactPredicate
<freemangordon> or osso_abook_aggregator_find_contacts_for_im_contact
<dsc_> i dont know how to use this
<dsc_> i want to focus on avatar-changed
<freemangordon> wait, wtym 'i dont know how to use this'?
<dsc_> well
<dsc_> I have to look into how to use `osso_abook_aggregator_find_contacts_for_im_contact`
<dsc_> or `osso_abook_aggregator_find_contacts_full`
<dsc_> and right now I want to do avatar-changed
<freemangordon> ok
<dsc_> and I dont know how to do avatar-changed :P
<dsc_> does this look ok?
<dsc_> (apart from using master list)
<freemangordon> yes, that's it
<dsc_> ok cool
<freemangordon> but I really have to run :)
<freemangordon> ask Wizzup for help with gtk/glib while I am away
<dsc_> (conversations:8645): GLib-GObject-WARNING **: 08:25:15.403: ../../../gobject/gsignal.c:2614: signal 'avatar-changed' is invalid for instance '0x555ee8f551d0' of type 'OssoABookContact'
<dsc_> nom nom
<dsc_> bye :D
<freemangordon> well, check what provides "avatar-changed"
<dsc_> $ grep -r --include="*.h" 'avatar-changed' /usr
<dsc_> nom nom
<dsc_> Wizzup: herrow, how to connect to the 'avatar-changed' signal? :P
Anasko has quit [Ping timeout: 265 seconds]
Livio has joined #maemo-leste
pere has joined #maemo-leste
<freemangordon> just use home applet as example
Livio has quit [Ping timeout: 260 seconds]
<freemangordon> if you don't use _swapped, then cb looks like:
<freemangordon> void notify_avatar_image_cb(OssoABookContact *contact, GdkPixbuf *image, gpointer user_data)
<freemangordon> umm, wait
MinceR has quit [Ping timeout: 252 seconds]
<freemangordon> it is void notify_avatar_image_cb(GObject *gobject, GParamSpec *pspec, gpointer user_data)
<freemangordon> gobject is the contact that changed the avatar
<dsc_> thx it worked
<dsc_> freemangordon: I dont think osso_abook_contact_get_avatar() is actually implemented yet
<sicelo> Wizzup: seems something's not right with how we start alarmd or something ... no rush though. i should be able to look into it the coming days
<sicelo> but alarm was correctly set and did wake device up when i ran alarmd manually. as run/started by the system, the rtc is never written to
<sicelo> ah, simple reason - we start alarmd as user. i guess side effect of using rootless xorg, since alarmd is started from xsession?
<sicelo> this explains why i remember it used to work, presumably when we still ran X11 as root
<sicelo> mmm
xmn has quit [Ping timeout: 246 seconds]
<Wizzup> let's see
<Wizzup> I think we give /dev/rtc? a udev rule and a group
<Wizzup> oh the rtc device is 700 even
<Wizzup> or, is this wht is even written to by alarm?
<sicelo> the whole thing works nicely when you start alarmd manually as root
<sicelo> but now i see we seem to have always started it as user (not related to rootless xorg). but yeah, as long as rtc is only managed by root (which is generally correct), then we cannot see a hw alarm
<sicelo> s/cannot see/cannot set/
Anasko has joined #maemo-leste
hm has joined #maemo-leste
ceene has quit [Read error: Connection reset by peer]
ceene has joined #maemo-leste
MinceR has joined #maemo-leste
MinceR has quit [Changing host]
MinceR has joined #maemo-leste
ceene has quit [Ping timeout: 252 seconds]
<Wizzup> sicelo: we can make udev rules for all rtc? devices
<Wizzup> set perms to 0660 and add the users group or some clock group
ceene has joined #maemo-leste
pere has quit [Ping timeout: 248 seconds]
Livio has joined #maemo-leste
Livio has quit [Ping timeout: 260 seconds]
pere has joined #maemo-leste
ceene has quit [Remote host closed the connection]
fab_ has joined #maemo-leste
<freemangordon> Wizzup: I think we shall start alarmd as root
<freemangordon> it even complains now on chimaera
<Wizzup> Why?
<freemangordon> dsc_: hmm, right, lemme fix that
<Wizzup> Why run it as root if it is a one linre to make /dev/rtc privs more sensible
<freemangordon> Wizzup: because we start it from xsession script
<Wizzup> so why start it as root?
<freemangordon> isn;t is sytem-wide daemon?
<Wizzup> that doesn't mean they should run as root
<freemangordon> or it is per user?
<freemangordon> so, you want every user session to has it's own alarmd?
<freemangordon> I don;t think that will work
<freemangordon> lemme check on which dbus session it registers
inky has quit [Ping timeout: 252 seconds]
<freemangordon> Wizzup: seems to work on system bus
<sicelo> i also do think rtc is best managed by root, so i would prefer running alarmd as root as well, leaving rtc permissions intact. less chance that something will try to overwrite the set wakeup time that way.
antranigv has quit [Ping timeout: 255 seconds]
antranigv has joined #maemo-leste
<freemangordon> lemme check what it does on fremantle
<freemangordon> 1352 user 3776 S /usr/sbin/alarmd
<freemangordon> oh
<freemangordon> what the?
<sicelo> and permissions of the rtc?
hm has quit [Read error: Connection reset by peer]
inky has joined #maemo-leste
<freemangordon> crw-rw---- 1 root audio 251, 0 Jan 1 1970 /dev/rtc0
<freemangordon> what a mess :)
<sicelo> lol, audio ...
<sicelo> so i guess that's how 'user' was able to manage it
<freemangordon> but, alarmd is started from xsession script with '/etc/init.d/alarmd start'
<freemangordon> that's...
<freemangordon> I am speechless
<sicelo> in Leste, we also do start it via openrc :p
<freemangordon> yes, but we took that from fremantle
<sicelo> the openrc? no, we must have made that ourselves
<sicelo> i actually think now the xsession already finds alarmd running (and thus is a no-op)
<sicelo> anyway, even the openrc script starts it as user 'user' :-)
<freemangordon> yes
<freemangordon> but why?
<sicelo> i guess we wanted to keep the fremantle behavior.
<freemangordon> I want to understand why it is run as user before making any decision
<freemangordon> this does not make any sense to me
<freemangordon> alarm queue is kept in /var
<freemangordon> so that is not per user
Livio has joined #maemo-leste
<freemangordon> Wizzup: I don;t understand why system-wide daemon should run as 'user' on system bus
<freemangordon> to me this looks like some ugly hack/overlook made by nokia back then
<freemangordon> btw, if there is no dsme, it will start as root
<freemangordon> (talking about original sysv init script)
<freemangordon> oh, it listens to both system and session bus
<Wizzup> sorry I was in a work meeting
<freemangordon> NP
<Wizzup> I think that the less that runs as root the better
<Wizzup> /dev/rtc0 is not audio on my droid btw
<freemangordon> in general I agree
<freemangordon> no, that's on fremantle
<Wizzup> and if alarmd only needs roor for /dev/rtc? then we just make a single udev rule
<freemangordon> so, in general I agree
<freemangordon> but, what will happen if we have start second user session
<freemangordon> *started
<Wizzup> if the second session has access to the system bus then it can talk with it just the same I guess?
<freemangordon> but it will try to start alarmd again
<freemangordon> it is the same as if we start mce as user
<freemangordon> from xsession
<sicelo> btw why does it need two buses? can it not be on system bus only?
<freemangordon> no idea
<freemangordon> that's why I think that's a mess
<freemangordon> Wizzup: it is not only /dev/rtc
<freemangordon> it takes care for *all* the alarms in the system
<freemangordon> which means that 'user' can delete /var/cache/alarm without going through dbus
<freemangordon> /var/cache/alarmd
<freemangordon> so, we either move cache dir to $HOME or run as root
<freemangordon> but, I guess that'd require major changes
<freemangordon> so yeah, the easiest way to go is rtc permissions
<freemangordon> dsc_: you don't need osso_abook_contact_get_avatar() as it requires master contact
<freemangordon> and I think we agreed that you want roster contact avatar
xmn has joined #maemo-leste
fab_ has quit [Quit: fab_]
fab_ has joined #maemo-leste
<sicelo> at least I can confirm that setting 660 permissions, and root:audio ownership on rtc0 does make the UI set alarm properly
antranigv_ has joined #maemo-leste
antranigv has quit [Ping timeout: 252 seconds]
<inky> i dont know if it's only for me, but from time to time i update maemo and try conversations., and whatever i write, reaches the other party, but whatever other party writes, doesn't reach me in conversations. reaches elsewhere.
<Wizzup> what connection manager is ths?
pere has quit [Ping timeout: 252 seconds]
pere has joined #maemo-leste
Livio_ has joined #maemo-leste
Livio has quit [Ping timeout: 260 seconds]
pere has quit [Ping timeout: 260 seconds]
System_Error has quit [Remote host closed the connection]
System_Error has joined #maemo-leste
pere has joined #maemo-leste
Livio_ has quit [Ping timeout: 260 seconds]
Livio has joined #maemo-leste
arno11 has joined #maemo-leste
arno11 has quit [Ping timeout: 246 seconds]
arno11 has joined #maemo-leste
hm has joined #maemo-leste
Anasko has quit [Read error: Connection reset by peer]
arno11 has left #maemo-leste [#maemo-leste]
Anasko has joined #maemo-leste
fab_ has quit [Quit: fab_]
Livio has quit [Ping timeout: 260 seconds]