Exemplo n.º 1
0
void QtUserSearchWindow::handleAccepted() {
	JID jid;
	std::vector<JID> jids;
	switch(type_) {
		case AddContact:
			jid = getContactJID();
			eventStream_->send(boost::make_shared<AddContactUIEvent>(jid, detailsPage_->getName(), detailsPage_->getSelectedGroups()));
			break;
		case ChatToContact:
			if (contactVector_.size() == 1) {
				boost::shared_ptr<UIEvent> event(new RequestChatUIEvent(contactVector_[0]->jid));
				eventStream_->send(event);
				break;
			}

			foreach(Contact::ref contact, contactVector_) {
				jids.push_back(contact->jid);
			}

			eventStream_->send(boost::make_shared<CreateImpromptuMUCUIEvent>(jids, JID(), Q2PSTRING(firstMultiJIDPage_->reason_->text())));
			break;
		case InviteToChat:
			foreach(Contact::ref contact, contactVector_) {
				jids.push_back(contact->jid);
			}
Exemplo n.º 2
0
Contact::ref QtUserSearchWindow::getContact() const {
    return std::make_shared<Contact>("", getContactJID(), StatusShow::None, "");
}