CancelAction::CancelAction( QWidget* parent ) : rviz::Panel( parent ) { layout = new QVBoxLayout; //Text Box and Add Button to add new topic QHBoxLayout* topic_layout = new QHBoxLayout; output_topic_editor_ = new QLineEdit; //topic_layout->addWidget( output_topic_editor_ ); add_topic_box_ = new QComboBox; initComboBox(); topic_layout->addWidget( add_topic_box_ ); QPushButton* add_topic_button_ = new QPushButton("Add Action"); topic_layout->addWidget( add_topic_button_ ); layout->addLayout( topic_layout ); //End of Text Box and Add Button m_sigmap = new QSignalMapper(this); connect(m_sigmap, SIGNAL(mapped(int)),this, SLOT(OnClickDeleteButton(int))); //Button to send cancel topic QPushButton* send_topic_button_ = new QPushButton("Cancel Action"); layout->addWidget( send_topic_button_ ); setLayout( layout ); connect( send_topic_button_, SIGNAL( clicked() ), this, SLOT( sendTopic ())); connect( add_topic_button_, SIGNAL( clicked() ), this, SLOT( addTopic() )); }
void Channel::addUser(chanClient *user) { chanClient *chan_client=(chanClient *)malloc(sizeof(chanClient)); if(chan_client == NULL) { fprintf(stderr, "Unable to allocate memory for channel client"); exit(1); } char *unick; if(user == NULL) { free((void *)chan_client); return; }; if(user->client == NULL) { free((void *)chan_client); return; }; user_list.push_back(chan_client); user->client->getUserInfo(&unick,NULL,NULL,NULL); memcpy(chan_client,user,sizeof(chanClient)); removeChannelInvite(user->client,this); chan_client->userKeys = new std::list<customKey *>(); sendToAllWithMode((int)EUserMode_ShowJoins,":SERVER!SERVER@* NOTICE :%s has joined %s",unick,getName()); if(this->auditorium != 2) { sendMessage(chan_client->invisible,false,chan_client->client,"JOIN %s",getName()); if(chan_client->invisible) { invisibleSend(":SERVER!SERVER@* NOTICE %s :INVISIBLE USER %s HAS JOINED",getName(),unick); } if(this->getNumUsers(true) > 1) { if(chan_client->invisible) { if(chan_client->halfop||chan_client->op||chan_client->owner) { invisibleSend(":SERVER!SERVER@* MODE %s +o %s",getName(),unick); } if(chan_client->voice) { invisibleSend(":SERVER!SERVER@* MODE %s +v %s",getName(),unick); } } else { if(chan_client->halfop||chan_client->op||chan_client->owner) { sendToChan(":SERVER!SERVER@* MODE %s +o %s",getName(),unick); } if(chan_client->voice) { sendToChan(":SERVER!SERVER@* MODE %s +v %s",getName(),unick); } } } } else { //auditorium chan_client->client->messageSend(chan_client->client,"JOIN %s",getName()); } sendNames(user->client); sendTopic(user->client); if(entrymsg[0] != 0) { user->client->sendToClient(":SERVER!SERVER@* NOTICE %s :%s",getName(),entrymsg); } return; }
void SpectrumMUCConversation::addUsers(AbstractUser *user, GList *cbuddies) { Log(m_jid, "ADDING USERS3"); GList *l = cbuddies; while (l != NULL) { PurpleConvChatBuddy *cb = (PurpleConvChatBuddy *)l->data; // std::string alias(cb->alias ? cb->alias: ""); std::string name(cb->name); int flags = GPOINTER_TO_INT(cb->flags); // PURPLE_CBFLAGS_OP // <presence // from='[email protected]/firstwitch' // to='[email protected]/pda'> // <x xmlns='http://jabber.org/protocol/muc#user'> // <item affiliation='member' role='participant'/> // </x> // </presence> Tag *tag = new Tag("presence"); tag->addAttribute("from", m_jid + "/" + name); tag->addAttribute("to", user->jid() + m_res); Tag *x = new Tag("x"); x->addAttribute("xmlns", "http://jabber.org/protocol/muc#user"); Tag *item = new Tag("item"); if (flags & PURPLE_CBFLAGS_OP || flags & PURPLE_CBFLAGS_HALFOP) { item->addAttribute("affiliation", "admin"); item->addAttribute("role", "moderator"); } else if (flags & PURPLE_CBFLAGS_FOUNDER) { item->addAttribute("affiliation", "owner"); item->addAttribute("role", "moderator"); } else { item->addAttribute("affiliation", "member"); item->addAttribute("role", "participant"); } if (name == m_nickname) { Tag *status = new Tag("status"); status->addAttribute("code", "110"); item->addChild(status); } x->addChild(item); tag->addChild(x); if (name == m_nickname) { if (m_lastPresence) delete m_lastPresence; m_lastPresence = tag->clone(); } Transport::instance()->send(tag); l = l->next; } if (!m_connected && !m_topic.empty()) { sendTopic(user); } m_connected = true; }
void SpectrumMUCConversation::changeTopic(AbstractUser *user, const char *who, const char *topic) { m_topic = topic ? topic : ""; m_topicUser = who ? who : m_jid.substr(0,m_jid.find('%')); // if (user->connected()) sendTopic(user); }