func (m *accountManager) findAccountForSession(s *session.Session) *account { acc, _ := m.getAccountByID(s.GetConfig().ID()) return acc }
func toggleConnectAndDisconnectMenuItems(s *session.Session, connect, disconnect *gtk.MenuItem) { doInUIThread(func() { connect.SetSensitive(s.IsDisconnected()) disconnect.SetSensitive(s.IsConnected()) }) }