Beispiel #1
0
func (p *Proxy) storeHistory(profileIP, id string, prof *profile.Profile) (string, string) {
	f := p.lives.OpenExists(profileIP)
	if f == nil {
		return "", ""
	}

	hID, err := strconv.ParseUint(id, 10, 32)
	if err != nil {
		return "", ""
	}

	h := f.LookHistoryByID(uint32(hID))
	if h.Error == nil && len(h.Bytes) > 0 {
		saveID := prof.StoreID(h.Bytes)
		return h.Url, saveID
	}

	return "", ""
}
Beispiel #2
0
func (p *Proxy) storeHistory(profileIP, id string, prof *profile.Profile) (string, string) {
	f := p.lives.OpenExists(profileIP)
	if f == nil {
		return "", ""
	}

	hID, err := strconv.ParseUint(id, 10, 32)
	if err != nil {
		return "", ""
	}

	h := f.LookHistoryByID(uint32(hID))
	if h == nil {
		return "", ""
	}

	content, err := h.Content()
	if err == nil {
		saveID := prof.StoreID(content)
		return h.Url, saveID
	}

	return "", ""
}