func (r *roster) createAccountPopup(jid string, account *account, bt gdki.EventButton) { mn := account.createSubmenu() mn.Append(account.createSeparatorItem()) mn.Append(account.createDumpInfoItem(r)) mn.ShowAll() mn.PopupAtMouseCursor(nil, nil, int(bt.Button()), bt.Time()) }
func (r *roster) createAccountPeerPopup(jid string, account *account, bt gdki.EventButton) { builder := newBuilder("ContactPopupMenu") mn := builder.getObj("contactMenu").(gtki.Menu) builder.ConnectSignals(map[string]interface{}{ "on_remove_contact": func() { account.session.RemoveContact(jid) r.ui.removePeer(account, jid) r.redraw() }, "on_edit_contact": func() { doInUIThread(func() { r.openEditContactDialog(jid, account) }) }, "on_allow_contact_to_see_status": func() { account.session.ApprovePresenceSubscription(jid, "" /* generate id */) }, "on_forbid_contact_to_see_status": func() { account.session.DenyPresenceSubscription(jid, "" /* generate id */) }, "on_ask_contact_to_see_status": func() { account.session.RequestPresenceSubscription(jid, "") }, "on_peer_fingerprints": func() { r.ui.showFingerprintsForPeer(jid, account) }, "on_dump_info": func() { r.debugPrintRosterFor(account.session.GetConfig().Account) }, }) mn.ShowAll() mn.PopupAtMouseCursor(nil, nil, int(bt.Button()), bt.Time()) }