psi icon indicating copy to clipboard operation
psi copied to clipboard

Add a quick way to open a chat dialog with a jid not from roster

Open Ri0n opened this issue 5 years ago • 0 comments

Currently it requires some magic to do so. I don't remember the way in fact but iirc it's possible.

Basically the solution is to add a fake contact "Start chat with this JID" to the roster when Search In Roster feature is active.

So we need to do next:

  1. in contactlistitem.h add another contact type like NewContact
  2. In most of the places where we handle type=Contact also add handling of NewContact
  3. an instance of ContactListItem with type NewContact will be added in advance to ContactListModel
  4. most of the type this contact will be hidden
  5. every time we come to PsiRosterWidget::filterEditTextChanged we set search text to the NewContact too
  6. The NewContact should treat this text as jid and if it's valid jid make itself visible otherwise hide.
  7. When a user clicks on the NewContact in the filtered roster a new ContactListItem should be cloned from it as type Contact and chat opened
  8. On disabling roster filtering the contact has to be hidden too.

Side effects: If we use contact list model for more then one view in the same time this NewContact may appear unexpectedly in other views too. But in general it shouldn't be a problem.

Ri0n avatar Apr 19 '20 10:04 Ri0n