psi
psi copied to clipboard
Add a quick way to open a chat dialog with a jid not from roster
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:
- in contactlistitem.h add another contact type like NewContact
- In most of the places where we handle type=Contact also add handling of NewContact
- an instance of ContactListItem with type NewContact will be added in advance to ContactListModel
- most of the type this contact will be hidden
- every time we come to PsiRosterWidget::filterEditTextChanged we set search text to the NewContact too
- The NewContact should treat this text as jid and if it's valid jid make itself visible otherwise hide.
- 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
- 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.