perlsky is a Perl 5 implementation of an AT Protocol Personal Data Server.
13
fork

Configure Feed

Select the types of activity you want to include in your feed.

Share sync event type constants

alice 61f0257c 7a59811c

+10 -4
+10 -4
lib/ATProto/PDS/API/Sync.pm
··· 10 10 11 11 use ATProto::PDS::EventStream qw(encode_message_frame); 12 12 use ATProto::PDS::API::Util qw(flatten_params iso8601 pump_event_subscription resolve_did_account subscription_start_seq xrpc_error); 13 + use ATProto::PDS::Constants qw( 14 + EVENT_TYPE_ACCOUNT 15 + EVENT_TYPE_COMMIT 16 + EVENT_TYPE_IDENTITY 17 + EVENT_TYPE_SYNC 18 + ); 13 19 use ATProto::PDS::Identity qw(service_host); 14 20 use ATProto::PDS::Moderation qw(assert_blob_readable assert_repo_readable); 15 21 use ATProto::PDS::Repo::CAR qw(write_car); ··· 327 333 } 328 334 329 335 sub _event_frame ($event) { 330 - if (($event->{type} // q()) eq 'commit') { 336 + if (($event->{type} // q()) eq EVENT_TYPE_COMMIT) { 331 337 return encode_message_frame('#commit', { 332 338 seq => 0 + $event->{seq}, 333 339 rebase => JSON::PP::false, ··· 353 359 }); 354 360 } 355 361 356 - if (($event->{type} // q()) eq 'sync') { 362 + if (($event->{type} // q()) eq EVENT_TYPE_SYNC) { 357 363 return encode_message_frame('#sync', { 358 364 seq => 0 + $event->{seq}, 359 365 did => $event->{did}, ··· 363 369 }); 364 370 } 365 371 366 - if (($event->{type} // q()) eq 'identity') { 372 + if (($event->{type} // q()) eq EVENT_TYPE_IDENTITY) { 367 373 return encode_message_frame('#identity', { 368 374 seq => 0 + $event->{seq}, 369 375 did => $event->{did}, ··· 372 378 }); 373 379 } 374 380 375 - if (($event->{type} // q()) eq 'account') { 381 + if (($event->{type} // q()) eq EVENT_TYPE_ACCOUNT) { 376 382 return encode_message_frame('#account', { 377 383 seq => 0 + $event->{seq}, 378 384 did => $event->{did},