Пример #1
0
void UserSearchController::handleNameSuggestionRequest(const JID &jid) {
    suggestionsJID_= jid;
    VCard::ref vcard = vcardManager_->getVCardAndRequestWhenNeeded(jid);
    if (vcard) {
        handleVCardChanged(jid, vcard);
    }
}
Пример #2
0
void ContactEditController::handleUIEvent(UIEvent::ref event) {
	RequestContactEditorUIEvent::ref editEvent = boost::dynamic_pointer_cast<RequestContactEditorUIEvent>(event);
	if (!editEvent) {
		return;
	}

	if (!contactEditWindow) {
		contactEditWindow = contactEditWindowFactory->createContactEditWindow();
		contactEditWindow->onRemoveContactRequest.connect(boost::bind(&ContactEditController::handleRemoveContactRequest, this));
		contactEditWindow->onChangeContactRequest.connect(boost::bind(&ContactEditController::handleChangeContactRequest, this, _1, _2));
	}
	currentContact = rosterController->getItem(editEvent->getJID());
	assert(currentContact);
	jid = rosterController->getItem(editEvent->getJID())->getJID();
	contactEditWindow->setContact(jid, currentContact->getName(), currentContact->getGroups(), rosterController->getGroups());
	contactEditWindow->show();

	if (vcardManager) {
		VCard::ref vcard = vcardManager->getVCardAndRequestWhenNeeded(jid);
		if (vcard) {
			handleVCardChanged(jid, vcard);
		}
	}
}