@@ -153,18 +153,23 @@ func UserRelationships(c *fiber.Ctx) error {
153153 }
154154
155155 connections := bridge.Connections {}
156+ connectionJSON := []string {}
156157
157158 if user .Viewer .Following != nil {
158159 connections .Connection = append (connections .Connection , bridge.Connection {Value : "following" })
160+ connectionJSON = append (connectionJSON , "following" )
159161 }
160162 if user .Viewer .FollowedBy != nil {
161163 connections .Connection = append (connections .Connection , bridge.Connection {Value : "followed_by" })
164+ connectionJSON = append (connectionJSON , "followed_by" )
162165 }
163166 if user .Viewer .Blocking != nil {
164167 connections .Connection = append (connections .Connection , bridge.Connection {Value : "blocked" })
168+ connectionJSON = append (connectionJSON , "blocking" )
165169 }
166170 if user .Viewer .BlockedBy {
167171 connections .Connection = append (connections .Connection , bridge.Connection {Value : "blocked_by" }) // Complete guess
172+ connectionJSON = append (connectionJSON , "blocked_by" )
168173 }
169174
170175 relationships = append (relationships , bridge.UsersRelationship {
@@ -174,18 +179,23 @@ func UserRelationships(c *fiber.Ctx) error {
174179 }
175180 return user .DisplayName
176181 }(),
177- ScreenName : user .Handle ,
178- ID : * encodedUserId ,
179- IDStr : strconv .FormatInt (* encodedUserId , 10 ),
180- Connections : connections ,
182+ ScreenName : user .Handle ,
183+ ID : * encodedUserId ,
184+ IDStr : strconv .FormatInt (* encodedUserId , 10 ),
185+ ConnectionsXML : connections ,
186+ Connections : connectionJSON ,
181187 })
182188 }
183189
184- root := bridge.UserRelationships {
185- Relationships : relationships ,
190+ if c .Params ("filetype" ) == "xml" {
191+ root := bridge.UserRelationships {
192+ Relationships : relationships ,
193+ }
194+ return EncodeAndSend (c , root )
195+ } else {
196+ return EncodeAndSend (c , relationships )
186197 }
187198
188- return EncodeAndSend (c , root )
189199}
190200
191201// Gets the relationship between two users
0 commit comments