GNOME Bugzilla – Bug 625969
Meta-contact class removals and rearrangements
Last modified: 2018-05-22 14:19:11 UTC
This can be a meta-bug for tracking which of Empathy's classes need to be removed or majorly changed as a result of the meta-contacts work. Below are some of my thoughts on various classes. Many of them are the result of only a few minutes' thought, so might not be optimal. * EmpathyContact: Currently a thin(ish) wrapper for FolksPersona. It should eventually disappear, but that requires capabilities and location support in libfolks. * EmpathyContactList Should perhaps change into an interface for Individuals, rather than contacts. * EmpathyContactManager Has been superceded by EmpathyIndividualManager. Should die. * EmpathySubscriptionDialog Should be changed to allow linking of the new subscription to existing Individuals. * EmpathyContactInformationDialog Has been superceded by EmpathyIndividualInformationDialog in this branch: http://git.collabora.co.uk/?p=user/pwith/empathy;a=shortlog;h=refs/heads/merging-ui-rebase3. Once that's merged, the EmpathyContactInformationDialog should die. * EmpathyContactEditDialog Should be replaced by a dialogue which allows editing of the whole Individual. * EmpathyContactPersonalDialog Should be replaced by a dialogue which shows the aggregated personal information of the whole Individual. * EmpathyNewContactDialog Should be changed to allow linking of the new contact to existing Individuals. * EmpathyContactListStore Should be stripped down and turned into an EmpathyPersonaStore, which lists the Personas for a given Individual. I can't think of any use-cases where we'd want the list of all Personas from all Individuals, but there are some cases where we'd want the Personas from a single Individual; such as in the linking dialogue, and when choosing a Persona to chat with or call. * EmpathyContactListView Similarly, this should be stripped down (e.g. groups support removed) into an EmpathyPersonaView. * EmpathyContactMenu I can't think of any cases where this would be necessary. It's been superceded by EmpathyIndividualMenu, and should be removed. * EmpathyContactSelector Should probably be replaced by an EmpathyIndividualSelector, although it's only used in the nautilus-sendto plugin at the moment, so might still need a way to select a Persona from an Individual in order to send files to the correct Persona. * EmpathyContactSelectorDialog Similarly, this should probably be replaced by an EmpathyIndividualSelectorDialog, which might need to allow selecting Personas out of Individuals. * EmpathyContactWidget This is being superceded by an EmpathyIndividualWidget as part of my work on the linking dialogue. The EmpathyIndividualWidget should allow the display of all the details of the Personas comprising the Individual, so the EmpathyContactWidget should eventually die.
This partially blocks bug #460647, although most of these removals and rearrangements can take place once meta-contacts support is in place.
(In reply to comment #0) > * EmpathyContact: > > Currently a thin(ish) wrapper for FolksPersona. It should eventually disappear, > but that requires capabilities and location support in libfolks. Ideally Empathy should just have to deal with FolksPersona and TpContact. Problem is we always use EmpathyContact when displaying log in the log viewer. Does it make sense having FolksPersona for those? We can't certainly have TpContact has the contacts may not exist any more. > * EmpathyContactList > > Should perhaps change into an interface for Individuals, rather than contacts. Keep it mind that this object is also used for the list of members of chatroom. Does it make sense to represent members of a room or IRC channel as Individuals? > * EmpathyContactManager > > Has been superceded by EmpathyIndividualManager. Should die. agreed. > * EmpathySubscriptionDialog > > Should be changed to allow linking of the new subscription to existing > Individuals. agreed. > * EmpathyContactInformationDialog > > Has been superceded by EmpathyIndividualInformationDialog in this branch: > http://git.collabora.co.uk/?p=user/pwith/empathy;a=shortlog;h=refs/heads/merging-ui-rebase3. > Once that's merged, the EmpathyContactInformationDialog should die. great! Feel free to open bug and link the branch once it's ready for review. > * EmpathyContactEditDialog > > Should be replaced by a dialogue which allows editing of the whole Individual. agreed. > * EmpathyContactPersonalDialog > > Should be replaced by a dialogue which shows the aggregated personal > information of the whole Individual. +1 > * EmpathyNewContactDialog > > Should be changed to allow linking of the new contact to existing Individuals. +1 > * EmpathyContactListStore > > Should be stripped down and turned into an EmpathyPersonaStore, which lists the > Personas for a given Individual. I can't think of any use-cases where we'd want > the list of all Personas from all Individuals, but there are some cases where > we'd want the Personas from a single Individual; such as in the linking > dialogue, and when choosing a Persona to chat with or call. I think this is used for chatrooms as well. > * EmpathyContactListView > > Similarly, this should be stripped down (e.g. groups support removed) into an > EmpathyPersonaView. idem > * EmpathyContactMenu > > I can't think of any cases where this would be necessary. It's been superceded > by EmpathyIndividualMenu, and should be removed. +1 > * EmpathyContactSelector > > Should probably be replaced by an EmpathyIndividualSelector, although it's only > used in the nautilus-sendto plugin at the moment, so might still need a way to > select a Persona from an Individual in order to send files to the correct > Persona. +1 > * EmpathyContactSelectorDialog > > Similarly, this should probably be replaced by an > EmpathyIndividualSelectorDialog, which might need to allow selecting Personas > out of Individuals. +1 > * EmpathyContactWidget > > This is being superceded by an EmpathyIndividualWidget as part of my work on > the linking dialogue. The EmpathyIndividualWidget should allow the display of > all the details of the Personas comprising the Individual, so the > EmpathyContactWidget should eventually die. Yep, we should get rid of it at some point.
(In reply to comment #0) I agree with everything else. Just a few comments: > * EmpathyContactList > > Should perhaps change into an interface for Individuals, rather than contacts. I'm not sure this needs to survive; the only reason it exists is for a common interface between EmpathyContactManager and EmpathyTpContactList. And EmpathyContactManager => EmpathyIndividualManager; EmpathyTpContactList => /dev/null. > * EmpathyContactInformationDialog > > Has been superceded by EmpathyIndividualInformationDialog in this branch: > http://git.collabora.co.uk/?p=user/pwith/empathy;a=shortlog;h=refs/heads/merging-ui-rebase3. > Once that's merged, the EmpathyContactInformationDialog should die. (See bug #626009 for the latest follow-up to this branch.) > * EmpathyNewContactDialog > > Should be changed to allow linking of the new contact to existing Individuals. Maybe this should let us add multiple contacts at once (linking them all together). It would support the use case "I just got someone's contact information with several IM UIDs". But that case is a lot rarer than "I got a new IM UID for someone I already have in my contact list" or "I just got (just one) IM UID for someone new", so it might not be worth extra clutter. > * EmpathyContactListStore > > Should be stripped down and turned into an EmpathyPersonaStore, which lists the > Personas for a given Individual. I can't think of any use-cases where we'd want > the list of all Personas from all Individuals, but there are some cases where > we'd want the Personas from a single Individual; such as in the linking > dialogue, and when choosing a Persona to chat with or call. Nice migration path for this. > * EmpathyContactSelector > > Should probably be replaced by an EmpathyIndividualSelector, although it's only > used in the nautilus-sendto plugin at the moment, so might still need a way to > select a Persona from an Individual in order to send files to the correct > Persona. It should probably have a construct-time property to determine whether a specific Persona should be selectable, since we'll need both versions of the dialog in different places.
(In reply to comment #3) > (In reply to comment #0) > > I agree with everything else. Just a few comments: > > > * EmpathyContactList > > > > Should perhaps change into an interface for Individuals, rather than contacts. > > I'm not sure this needs to survive; the only reason it exists is for a common > interface between EmpathyContactManager and EmpathyTpContactList. And > EmpathyContactManager => EmpathyIndividualManager; EmpathyTpContactList => > /dev/null. Yeah we should probably simplify all this. We don't need this complex design (interfaces, subclasses, etc) if "contact list" is only usedf for rooms. > > * EmpathyNewContactDialog > > > > Should be changed to allow linking of the new contact to existing Individuals. > > Maybe this should let us add multiple contacts at once (linking them all > together). It would support the use case "I just got someone's contact > information with several IM UIDs". But that case is a lot rarer than "I got a > new IM UID for someone I already have in my contact list" or "I just got (just > one) IM UID for someone new", so it might not be worth extra clutter. I wouldn't worry too much. This case is mostly "please import this vCard" so we should actually import the vCard file rather than forcing user to type all its field manually.
(In reply to comment #0) > * EmpathyContactManager > > Has been superceded by EmpathyIndividualManager. Should die. EmpathyEventManager uses EmpathyContactManager to: a) Get the "pending" contacts (those who want to add us to their contact list) b) Be notified when contacts are added/removed I didn't see any API in the IndividualManager for a). Is it planned to add folks API for that or should we use TP directly (probably using the new ContactList API) ? I guess for b) we can just use the "members-changed" on the IndividualManager.
(In reply to comment #5) > (In reply to comment #0) > > * EmpathyContactManager > > > > Has been superceded by EmpathyIndividualManager. Should die. > > EmpathyEventManager uses EmpathyContactManager to: > a) Get the "pending" contacts (those who want to add us to their contact list) > b) Be notified when contacts are added/removed > > I didn't see any API in the IndividualManager for a). Is it planned to add > folks API for that or should we use TP directly (probably using the new > ContactList API) ? I wasn't planning to expose the local-pending or remote-pending lists in Folks, since I don't think most clients are interested in them. But in our API changes for 0.3.x, the PersonaStores (which are wrappers for TpAccounts/Connections) are more accessible to the client, so maybe I could expose the lists for the Telepathy-specific PersonaStore. I've added a note to our API-change-tracking bug #629078 about this. > I guess for b) we can just use the "members-changed" on the IndividualManager. Yes, this includes lists of Individuals added/removed.
Created attachment 172307 [details] [review] Use the new PersonaStore capabilities to remove ContactManager from IndividualManager This doesn't remove ContactManager entirely (and obviously doesn't solve all of this bug), since there's quite a bit of work left before we can do that. This is a squashed diff of this branch: http://git.collabora.co.uk/?p=user/treitter/empathy.git;a=shortlog;h=refs/heads/bgo625969-use-persona-store-caps
Review of attachment 172307 [details] [review]: Looks good to me! ::: configure.ac @@ +33,2 @@ # Hardp deps +FOLKS_REQUIRED=0.3.0.1 Shouldn't that be 0.3.1? API additions shouldn't be made in a nano release.
(In reply to comment #8) > Review of attachment 172307 [details] [review]: > > Looks good to me! > > ::: configure.ac > @@ +33,2 @@ > # Hardp deps > +FOLKS_REQUIRED=0.3.0.1 > > Shouldn't that be 0.3.1? API additions shouldn't be made in a nano release. Yeah, I was planning to bump that to 0.3.1 after I make that release (which may be sooner or later, depending on how long it takes to implement Individual/Persona capabilities).
(In reply to comment #8) > Review of attachment 172307 [details] [review]: > > Looks good to me! > > ::: configure.ac > @@ +33,2 @@ > # Hardp deps > +FOLKS_REQUIRED=0.3.0.1 > > Shouldn't that be 0.3.1? API additions shouldn't be made in a nano release. Merged after the 0.3.1 release: commit 2c5175128196c93f648b165bc7e155f5d9cef1c3 Author: Travis Reitter <travis.reitter@collabora.co.uk> Date: Wed Oct 13 11:36:05 2010 -0700 Retain the ContactManager for the lifetime of the main window. The ContactManager doesn't cleanly disconnect its signals when it's finalize (or initialized), so we need to retain it for the lifetime of the main windo to avoid segfaults. It's not worth fixing the ContactManager, since we're planning to remove it. src/empathy-main-window.c | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) commit 1291ec05478f211d37479fc98904d9d3dda743b0 Author: Travis Reitter <travis.reitter@collabora.co.uk> Date: Tue Oct 12 23:22:23 2010 -0700 Remove obsolete ContactManager from IndividualManager. Helps bgo#625969. libempathy/empathy-individual-manager.c | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-) commit f5f2d3a1cf71a4fc89c517a15d1413bfd1bfcac5 Author: Travis Reitter <travis.reitter@collabora.co.uk> Date: Tue Oct 12 23:20:55 2010 -0700 Cut obsolete IndividualManagerFlags. Helps bgo#625969. libempathy/empathy-individual-manager.c | 30 ------------------------------ libempathy/empathy-individual-manager.h | 13 ------------- 2 files changed, 0 insertions(+), 43 deletions(-) commit 5598cb0b0b012199fb5cfe8a0f2a5b05ed8078c8 Author: Travis Reitter <travis.reitter@collabora.co.uk> Date: Tue Oct 12 23:16:17 2010 -0700 Add missing #include. libempathy/empathy-contact.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) commit a4cd05f5f8aeb4067652e4806f0e125b221d8ad1 Author: Travis Reitter <travis.reitter@collabora.co.uk> Date: Tue Oct 12 22:45:53 2010 -0700 Use Folks to check if a TpConnection can alias and group personas. Helps bgo#625969. libempathy-gtk/empathy-individual-menu.c | 7 ++----- libempathy/empathy-utils.c | 28 ++++++++++++++++++++++++++++ libempathy/empathy-utils.h | 2 ++ 3 files changed, 32 insertions(+), 5 deletions(-) commit 4f39984ad575e8ee643e3cf52ad519386c23009e Author: Travis Reitter <travis.reitter@collabora.co.uk> Date: Tue Oct 12 09:45:03 2010 -0700 Use Folks to check if a TpConnection can add personas. Helps bgo#625969. libempathy-gtk/empathy-individual-dialogs.c | 3 +- libempathy/empathy-utils.c | 52 +++++++++++++++++++++++++++ libempathy/empathy-utils.h | 3 ++ 3 files changed, 56 insertions(+), 2 deletions(-) commit 31905d995ddb96e2e25a795fa197cb541bc7724d Author: Travis Reitter <travis.reitter@collabora.co.uk> Date: Mon Oct 11 12:52:18 2010 -0700 Use Folks to check the ability to remove Individuals in the store & view. Helps bgo#625969. configure.ac | 2 +- libempathy-gtk/empathy-individual-store.c | 14 ++------ libempathy-gtk/empathy-individual-store.h | 1 - libempathy-gtk/empathy-individual-view.c | 51 ++++++++++++---------------- libempathy-gtk/empathy-individual-view.h | 3 -- 5 files changed, 27 insertions(+), 44 deletions(-)
Guillaume, with all your recent code pruning, what still needs doing here?
Long story short: we have done a lot of work this cycle but we are not there yet. :) (In reply to comment #0) > * EmpathyContact: Still there, mostly as a wrapper on TpContact/FolksIndividual/TplContact. I suspect we won't manage to get rid of it soon. Note that adding location support to FolksIndividual would allow us to remove a bunch of code from it. > * EmpathyContactList > > Should perhaps change into an interface for Individuals, rather than contacts. Lot of code has been removed but not all. We should probably be able to get rid of it once we'll have high level API in tp-glib to invite contacts to channel. > * EmpathyContactManager > > Has been superceded by EmpathyIndividualManager. Should die. It died. \o/ > * EmpathySubscriptionDialog > > Should be changed to allow linking of the new subscription to existing > Individuals. This object doesn't exist anymore but we still can't merge new contacts right away. > * EmpathyContactInformationDialog > > Has been superceded by EmpathyIndividualInformationDialog in this branch: > http://git.collabora.co.uk/?p=user/pwith/empathy;a=shortlog;h=refs/heads/merging-ui-rebase3. > Once that's merged, the EmpathyContactInformationDialog should die. It's gone. > * EmpathyContactEditDialog > > Should be replaced by a dialogue which allows editing of the whole Individual. Replaced by EmpathyIndividualEditDialog. > * EmpathyContactPersonalDialog > > Should be replaced by a dialogue which shows the aggregated personal > information of the whole Individual. It's gone. > * EmpathyNewContactDialog It's gone. > * EmpathyContactListStore It's gone. > * EmpathyContactListView gone as well. > * EmpathyContactMenu gone; replaced by IndividualMenu. > * EmpathyContactSelector > > Should probably be replaced by an EmpathyIndividualSelector, although it's only > used in the nautilus-sendto plugin at the moment, so might still need a way to > select a Persona from an Individual in order to send files to the correct > Persona. Replaced by EmpathyContactChooser displaying individuals. > * EmpathyContactSelectorDialog ditto. > * EmpathyContactWidget > > This is being superceded by an EmpathyIndividualWidget as part of my work on > the linking dialogue. The EmpathyIndividualWidget should allow the display of > all the details of the Personas comprising the Individual, so the > EmpathyContactWidget should eventually die. Seems to be still there but I'm not sure what's still using it.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/empathy/issues/264.