@@ -41,7 +41,7 @@ const pkg = JSON.parse(
4141const ccEndpoints : Record < string , string > = {
4242 "net.concrnt.activitypub.info" : "/ap/api/info" ,
4343 "net.concrnt.activitypub.setup" : "/ap/api/setup" , // POST {id}
44- "net.concrnt.activitypub.settings" : "/ap/api/settings" , // GET=取得 / POST=更新
44+ "net.concrnt.activitypub.settings" : "/ap/api/settings" , // GET=取得 (listenTimelines等のユーザー設定はcckvレコード側)
4545 "net.concrnt.activitypub.stats" : "/ap/api/stats" ,
4646 "net.concrnt.activitypub.followers" : "/ap/api/followers" ,
4747 "net.concrnt.activitypub.following" : "/ap/api/following" ,
@@ -101,14 +101,12 @@ app.post("/ap/api/setup", async (c) => {
101101 id : id . toLowerCase ( ) ,
102102 ccid : ccid ,
103103 enabled : true ,
104- listenTimelines : [ ] ,
105104 } )
106105
107106 return c . json ( {
108107 id : id ,
109108 ccid : ccid ,
110109 enabled : true ,
111- listenTimelines : [ ] ,
112110 } )
113111
114112} ) ;
@@ -131,35 +129,9 @@ app.get("/ap/api/settings", async (c) => {
131129 ccid : entity . ccid ,
132130 id : entity . id ,
133131 enabled : entity . enabled ,
134- listenTimelines : entity . listenTimelines ,
135132 } ) ;
136133} ) ;
137134
138- app . post ( "/ap/api/settings" , async ( c ) => {
139-
140- const authInfo = receiveAuthInfo ( c )
141- if ( ! authInfo ) {
142- return c . json ( { error : "Missing authentication information" } , 400 ) ;
143- }
144-
145- const id = authInfo . ccid
146-
147- const entity = await db . select ( ) . from ( apEntity ) . where ( eq ( apEntity . ccid , id ) ) . limit ( 1 ) . then ( res => res [ 0 ] ) ;
148- if ( ! entity ) {
149- return c . json ( { error : "No ActivityPub entity found for this user" } , 404 ) ;
150- }
151-
152- const { listenTimelines } = await c . req . json ( ) ;
153-
154- await db . update ( apEntity )
155- . set ( {
156- listenTimelines : listenTimelines ?? entity . listenTimelines ,
157- } )
158- . where ( eq ( apEntity . ccid , id ) ) ;
159-
160- return c . json ( { message : "Settings updated successfully" } ) ;
161- } ) ;
162-
163135
164136app . get ( "/ap/api/stats" , async ( c ) => {
165137
0 commit comments