summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--cache/index.go11
-rw-r--r--cache/types.go8
2 files changed, 15 insertions, 4 deletions
diff --git a/cache/index.go b/cache/index.go
index e0a3dd0..641e6dc 100644
--- a/cache/index.go
+++ b/cache/index.go
@@ -1,5 +1,10 @@
 package cache
 
+import (
+	"log"
+	"time"
+)
+
 // NewUserIndex returns a new instance of a user index
 func NewUserIndex() *UserIndex {
 	return &UserIndex{}
@@ -7,8 +12,12 @@ func NewUserIndex() *UserIndex {
 
 // AddUser inserts a new user into the index. The *Data struct only contains the nickname.)
 func (index UserIndex) AddUser(nick string, url string) {
+	rfc3339date, err := time.Now().MarshalText()
+	if err != nil {
+		log.Printf("Error formatting user add time as RFC3339: %v\n", err)
+	}
 	imutex.Lock()
-	index[url] = &Data{nick: nick}
+	index[url] = &Data{nick: nick, date: time.Now(), apidate: rfc3339date}
 	imutex.Unlock()
 }
 
diff --git a/cache/types.go b/cache/types.go
index 8f364d5..ed270c3 100644
--- a/cache/types.go
+++ b/cache/types.go
@@ -2,6 +2,7 @@ package cache
 
 import (
 	"sync"
+	"time"
 )
 
 // Indexer allows for other uses of the Index functions
@@ -15,9 +16,10 @@ type UserIndex map[string]*Data
 
 // Data from user's twtxt.txt
 type Data struct {
-	nick   string
-	url    string
-	status []string
+	nick    string
+	date    time.Time
+	apidate []byte
+	status  []string
 }
 
 // Mutex to control access to the User Index
ger.gui.widgets.browsercolumn.html?h=v1.0.4&id=4e9450f955e763a4d301645ab11201834d8a0ccc'>4e9450f9 ^
4c13e1f2 ^
b3556b21 ^











4c13e1f2 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175