about summary refs log tree commit diff stats
path: root/client.c
Commit message (Expand)AuthorAgeFilesLines
* added attach/detach functions which don't attach at the begin of list, but at...Anselm R. Garbe2006-08-291-12/+4
* removed crappy variablesAnselm R. Garbe2006-08-281-3/+1
* applied sanders focus_ patchesAnselm R. Garbe2006-08-281-25/+48
* updated man pageAnselm R. Garbe2006-08-231-13/+9
* separated several functions into view.cAnselm R. Garbe2006-08-221-61/+0
* windows which have set transient_for hint inherit the transient_for window ta...arg@localhost.10kloc.org2006-08-211-1/+6
* after switching to OpenBSD again, I switched back to a saner color schemearg@localhost.10kloc.org2006-08-211-5/+7
* applied Sanders focus_* patches, removed the unnecessary clean-prefix from th...Anselm R.Garbe2006-08-211-28/+30
* applied Sanders patchAnselm R.Garbe2006-08-181-6/+2
* made a new client position strategy similiar to that one proposed by Sander, ...Anselm R.Garbe2006-08-181-7/+7
* fixed a bug reported by sanderAnselm R.Garbe2006-08-171-1/+1
* centering apps only if transient_for is not(!) setAnselm R.Garbe2006-08-171-9/+1
* fixed issue Sander reportedAnselm R.Garbe2006-08-171-4/+3
* condition was insufficientAnselm R.Garbe2006-08-161-2/+2
* fixed issue reported by sanderAnselm R.Garbe2006-08-161-0/+4
* added general centralization rule for new clients (works around various borke...Anselm R.Garbe2006-08-161-1/+10
* removed NUMLOCKMASK, added dynamically calculated numlockmask insteadAnselm R.Garbe2006-08-141-6/+6
* fixedAnselm R.Garbe2006-08-141-8/+4
* added some flicker preventionAnselm R.Garbe2006-08-141-1/+3
* fixed a core dumpAnselm R.Garbe2006-08-141-1/+0
* implemented restack behavior (floats are on top in tiled mode)Anselm R.Garbe2006-08-141-18/+8
* implement multi-tag selection through button3 click on the specific tagAnselm R.Garbe2006-08-111-2/+2
* applied Sander's patch as wellAnselm R.Garbe2006-08-111-2/+1
* simplified unmanageAnselm R.Garbe2006-08-111-7/+2
* removed the if(clients) check from popping codeAnselm R.Garbe2006-08-111-2/+1
* applied Sanders zoom_update patchAnselm R.Garbe2006-08-101-1/+1
* respecting inc hints in floating mode on togglemaxAnselm R.Garbe2006-08-101-1/+1
* reverting last patch, that sucks, I don't care about retarded apps like gvimAnselm R.Garbe2006-08-101-1/+1
* togglemax repects inc-hints (this way gvim can be toggle'maxed as well)Anselm R.Garbe2006-08-101-1/+1
* applied sumik's multihead patchAnselm R.Garbe2006-08-101-0/+2
* disallow zoom on maximized clientsAnselm R.Garbe2006-08-101-7/+0
* removed NET_ACTIVE_WINDOW handlingAnselm R.Garbe2006-08-081-5/+0
* implemented NET_ACTIVE_WINDOW supportAnselm R.Garbe2006-08-081-0/+5
* applied endless loop prevention on zoom()arg@10ksloc.org2006-08-071-1/+3
* small fix of the last commitarg@10ksloc.org2006-08-051-1/+1
* using -Os again, zoom is ignored in floating mode or on floating clientsarg@10ksloc.org2006-08-051-1/+1
* mouse grab needs also to grab for combinations of numlock/lockmaskarg@10ksloc.org2006-08-051-0/+20
* removed TLast tag enum, now tags is simple defined as char *[] array, the res...arg@10ksloc.org2006-08-031-1/+3
* changed Client->tags and Rule->tags to be Bool (I'll also try to remove the T...arg@10ksloc.org2006-08-031-1/+1
* made fullscreen apps working fine in floating mode (there is no sane way to m...arg@10ksloc.org2006-08-021-22/+10
* new stuffarg@10ksloc.org2006-08-021-15/+21
* implemented focus on enterwindow on titlebarsarg@10ksloc.org2006-08-021-1/+1
* reverting to old resize policyarg@10ksloc.org2006-08-021-11/+19
* new resize stuff (using XConfigureWindow instead of XSendEvent)arg@10ksloc.org2006-08-021-19/+11
* renamed WM_PROTOCOL_DELWIN into PROTODELWINarg@10ksloc.org2006-08-011-1/+1
* removed artefacts of single-linked list (thanx to Jukka, I must have been mad)arg@10ksloc.org2006-08-011-8/+3
* uppercasing all define'd values (uppercase-prefixed should only be enum field...arg@10ksloc.org2006-08-011-3/+3
* applied Sanders patchesarg@10ksloc.org2006-08-011-3/+3
* committed a patch which fixes the hints of Jukkaarg@10ksloc.org2006-08-011-34/+8
* sanitization of several clunky stuff, removed heretag (rarely of use), simpli...arg@10ksloc.org2006-07-211-2/+15
">: pool, } w.worker.PostMessage(request, nil) response := <-w.worker.Actions if response.InResponseTo() != request { return fmt.Errorf("Expected UI to respond to cert request") } if approval, ok := response.(*types.ApproveCertificate); !ok { return fmt.Errorf("Expected UI to send certificate approval") } else { if approval.Approved { return nil } else { return fmt.Errorf("UI rejected certificate") } } } } func (w *IMAPWorker) handleMessage(msg types.WorkerMessage) error { switch msg := msg.(type) { case *types.Unsupported: // No-op case *types.Configure: u, err := url.Parse(msg.Config.Source) if err != nil { return err } w.config.scheme = u.Scheme if strings.HasSuffix(w.config.scheme, "+insecure") { w.config.scheme = strings.TrimSuffix(w.config.scheme, "+insecure") w.config.insecure = true } w.config.addr = u.Host if !strings.ContainsRune(w.config.addr, ':') { w.config.addr += ":" + u.Scheme } w.config.scheme = u.Scheme w.config.user = u.User case *types.Connect: var ( c *client.Client err error ) tlsConfig := &tls.Config{ InsecureSkipVerify: true, VerifyPeerCertificate: w.verifyPeerCert(msg), } switch w.config.scheme { case "imap": c, err = client.Dial(w.config.addr) if err != nil { return err } if !w.config.insecure { if err := c.StartTLS(tlsConfig); err != nil { return err } } case "imaps": c, err = client.DialTLS(w.config.addr, tlsConfig) if err != nil { return err } default: return fmt.Errorf("Unknown IMAP scheme %s", w.config.scheme) } if w.config.user != nil { username := w.config.user.Username() password, hasPassword := w.config.user.Password() if !hasPassword { // TODO: ask password } if err := c.Login(username, password); err != nil { return err } } if _, err := c.Select(imap.InboxName, false); err != nil { return err } c.Updates = w.updates w.client = &imapClient{c, idle.NewClient(c)} w.worker.PostMessage(&types.Done{types.RespondTo(msg)}, nil) case *types.ListDirectories: w.handleListDirectories(msg) default: return errUnsupported } return nil } func (w *IMAPWorker) Run() { for { select { case msg := <-w.worker.Actions: msg = w.worker.ProcessAction(msg) if err := w.handleMessage(msg); err == errUnsupported { w.worker.PostMessage(&types.Unsupported{ Message: types.RespondTo(msg), }, nil) } else if err != nil { w.worker.PostMessage(&types.Error{ Message: types.RespondTo(msg), Error: err, }, nil) } case update := <-w.updates: w.worker.Logger.Printf("(= %T", update) } } }