~psic4t/qcal

d972eecd4419200bb8dcc67878c243fc5c79701f — psic4t 2 months ago 0a97b21 master 0.8.9
fix Google readonly calendars. RW does and will not work though.
3 files changed, 15 insertions(+), 7 deletions(-)

M defines.go
M helpers.go
M main.go
M defines.go => defines.go +1 -1
@@ 24,7 24,7 @@ var endDateUTC string
var summary string
var toFile bool
var elements []Event
var qcalversion string = "0.8.8"
var qcalversion string = "0.8.9"

var colorBlock string = "|"
var currentDot string = "•"

M helpers.go => helpers.go +3 -1
@@ 79,6 79,8 @@ func getCalProp(calNo int, p *[]calProps, wg *sync.WaitGroup) {
	}

	xmlContent, _ := ioutil.ReadAll(resp.Body)

	//fmt.Println(string(xmlContent))
	defer resp.Body.Close()

	var displayName string


@@ 113,7 115,7 @@ func inTimeSpan(start, end, check time.Time) bool {
	return check.After(start) && check.Before(end)
}

//func fancyOutput(elem *event) {
// func fancyOutput(elem *event) {
func (e Event) fancyOutput() {
	// whole day or greater
	if e.Start.Format(timeFormat) == e.End.Format(timeFormat) {

M main.go => main.go +11 -5
@@ 27,14 27,20 @@ func fetchCalData(calNo int, wg *sync.WaitGroup) {

	//fmt.Println(xmlBody)
	reqType := "REPORT"

	if config.Calendars[calNo].Username == "" {
		reqType = "GET"
		reqType = "GET" // some servers don't like REPORT
		xmlBody = ""
	}

	req, _ := http.NewRequest(reqType, config.Calendars[calNo].Url, strings.NewReader(xmlBody))
	req.SetBasicAuth(config.Calendars[calNo].Username, config.Calendars[calNo].Password)
	req.Header.Add("Content-Type", "application/xml; charset=utf-8")
	req.Header.Add("Depth", "1") // needed for SabreDAV
	req.Header.Add("Prefer", "return-minimal")

	if config.Calendars[calNo].Username != "" {
		req.SetBasicAuth(config.Calendars[calNo].Username, config.Calendars[calNo].Password)
		req.Header.Add("Depth", "1") // needed for SabreDAV
		req.Header.Add("Prefer", "return-minimal")
		req.Header.Add("Content-Type", "application/xml; charset=utf-8")
	}

	/*tr := &http.Transport{
		TLSClientConfig: &tls.Config{InsecureSkipVerify: true},