unbookmark added. Bookmarks implementation should be complete now.
This commit is contained in:
+51
-4
@@ -256,7 +256,7 @@ EOF
|
|||||||
dmupdate credurl blockurl blockdelurl muteurl mutedelurl friendsurl
|
dmupdate credurl blockurl blockdelurl muteurl mutedelurl friendsurl
|
||||||
modifyliurl adduliurl delliurl getliurl getlisurl getfliurl
|
modifyliurl adduliurl delliurl getliurl getlisurl getfliurl
|
||||||
creliurl delliurl deluliurl crefliurl delfliurl
|
creliurl delliurl deluliurl crefliurl delfliurl
|
||||||
getuliurl getufliurl dmsenturl reblogurl boostsbyurl dmidurl
|
getuliurl getufliurl dmsenturl reblogurl boostsbyurl bookmarkurl unbookmarkurl dmidurl
|
||||||
statusliurl followliurl leaveliurl followersurl
|
statusliurl followliurl leaveliurl followersurl
|
||||||
oauthurl oauthauthurl oauthaccurl oauthbase wtrendurl
|
oauthurl oauthauthurl oauthaccurl oauthbase wtrendurl
|
||||||
atrendurl lookupidurl
|
atrendurl lookupidurl
|
||||||
@@ -282,7 +282,7 @@ EOF
|
|||||||
nocounter linelength friendsurl followersurl lists
|
nocounter linelength friendsurl followersurl lists
|
||||||
modifyliurl adduliurl delliurl getliurl getlisurl getfliurl
|
modifyliurl adduliurl delliurl getliurl getlisurl getfliurl
|
||||||
creliurl delliurl deluliurl crefliurl delfliurl atrendurl
|
creliurl delliurl deluliurl crefliurl delfliurl atrendurl
|
||||||
getuliurl getufliurl dmsenturl reblogurl boostsbyurl wtrendurl
|
getuliurl getufliurl dmsenturl reblogurl boostsbyurl bookmarkurl unbookmarkurl wtrendurl
|
||||||
statusliurl followliurl leaveliurl dmidurl nostreamreplies
|
statusliurl followliurl leaveliurl dmidurl nostreamreplies
|
||||||
frupdurl filterusers filterats filterrts filterflags
|
frupdurl filterusers filterats filterrts filterflags
|
||||||
filteratonly nofilter
|
filteratonly nofilter
|
||||||
@@ -388,6 +388,8 @@ EOF
|
|||||||
$idurl = "${apibase}/statuses/%I";
|
$idurl = "${apibase}/statuses/%I";
|
||||||
$delurl = "${apibase}/statuses/%I";
|
$delurl = "${apibase}/statuses/%I";
|
||||||
$reblogurl = "${apibase}/statuses/%I/reblog";
|
$reblogurl = "${apibase}/statuses/%I/reblog";
|
||||||
|
$bookmarkurl = "${apibase}/statuses/%I/bookmark";
|
||||||
|
$unbookmarkurl = "${apibase}/statuses/%I/unbookmark";
|
||||||
$wurl = "${apibase}/accounts/%I";
|
$wurl = "${apibase}/accounts/%I";
|
||||||
$followurl = "${apibase}/accounts/%I/follow";
|
$followurl = "${apibase}/accounts/%I/follow";
|
||||||
$leaveurl = "${apibase}/accounts/%I/unfollow";
|
$leaveurl = "${apibase}/accounts/%I/unfollow";
|
||||||
@@ -691,7 +693,7 @@ if ($termrl && $termrl->ReadLine eq 'Term::ReadLine::Gnu') {
|
|||||||
/listfriends /followers /following /dump /du /eval /ev
|
/listfriends /followers /following /dump /du /eval /ev
|
||||||
/version /update /versioncheck /updatecheck
|
/version /update /versioncheck /updatecheck
|
||||||
/thread /th /entities /ent /delete
|
/thread /th /entities /ent /delete
|
||||||
/deletelast /boostsof /rtsof /vote /whois /w /me
|
/deletelast /boostsof /rtsof /bookmark /unbookmark /vote /whois /w /me
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
# Dynamic extraction from source code
|
# Dynamic extraction from source code
|
||||||
@@ -1329,6 +1331,8 @@ $delurl ||= "${apibase}/statuses/%I";
|
|||||||
|
|
||||||
$reblogurl ||= "${apibase}/statuses/%I/reblog";
|
$reblogurl ||= "${apibase}/statuses/%I/reblog";
|
||||||
$boostsbyurl ||= "${apibase}/statuses/%I/reblogged_by";
|
$boostsbyurl ||= "${apibase}/statuses/%I/reblogged_by";
|
||||||
|
$bookmarkurl ||= "${apibase}/statuses/%I/bookmark";
|
||||||
|
$unbookmarkurl ||= "${apibase}/statuses/%I/unbookmark";
|
||||||
# Twitter endpoints removed - not available in fediverse
|
# Twitter endpoints removed - not available in fediverse
|
||||||
# $boostsofmeurl: No direct equivalent in fediverse (privacy feature)
|
# $boostsofmeurl: No direct equivalent in fediverse (privacy feature)
|
||||||
|
|
||||||
@@ -3191,6 +3195,8 @@ Example:
|
|||||||
/url a5 - opens all URLs in post a5
|
/url a5 - opens all URLs in post a5
|
||||||
/delete a5 - deletes post a5, if it's your post
|
/delete a5 - deletes post a5, if it's your post
|
||||||
/boost a5 - boosts post a5
|
/boost a5 - boosts post a5
|
||||||
|
/bookmark a5 - bookmarks post a5
|
||||||
|
/unbookmark a5 - removes bookmark from post a5
|
||||||
/vote a5 2 - vote for option 2 on poll in post a5
|
/vote a5 2 - vote for option 2 on poll in post a5
|
||||||
/vote a5 1,3 - vote for options 1 and 3 (if multiple choice)
|
/vote a5 1,3 - vote for options 1 and 3 (if multiple choice)
|
||||||
/replyall a5 message - reply to all users mentioned in post a5
|
/replyall a5 message - reply to all users mentioned in post a5
|
||||||
@@ -3996,6 +4002,22 @@ m#^/(un)?f(boost|a|av|ave|avorite|avourite)? ([zZ]?[a-zA-Z]?[0-9]+)$#) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Bookmark/Unbookmark commands
|
||||||
|
if (m#^/(un)?bookmark ([zZ]?[a-zA-Z]?[0-9]+)$#) {
|
||||||
|
my $mode = $1;
|
||||||
|
my $code = lc($2);
|
||||||
|
my $post = &get_post($code);
|
||||||
|
if (!defined($post)) {
|
||||||
|
print $stdout "-- no such post (yet?): $code\n";
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
&cordbookmark($post->{'id_str'}, 1,
|
||||||
|
(($mode eq 'un') ? $unbookmarkurl : $bookmarkurl),
|
||||||
|
&descape($post->{'text'}),
|
||||||
|
(($mode eq 'un') ? 'removed' : 'created'));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
# enable and disable NewRTs from users
|
# enable and disable NewRTs from users
|
||||||
# we allow this even if newRTs are off from -noreblogs
|
# we allow this even if newRTs are off from -noreblogs
|
||||||
if (s#^/rts(on|off)\s+## && length) {
|
if (s#^/rts(on|off)\s+## && length) {
|
||||||
@@ -7389,6 +7411,31 @@ sub cordfav {
|
|||||||
return $en;
|
return $en;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# create or destroy a bookmark
|
||||||
|
sub cordbookmark {
|
||||||
|
my $id = shift;
|
||||||
|
my $interactive = shift;
|
||||||
|
my $basebookmark = shift;
|
||||||
|
my $text = shift;
|
||||||
|
my $verb = shift;
|
||||||
|
|
||||||
|
# Substitute the post ID into the URL template
|
||||||
|
my $bookmark_url = $basebookmark;
|
||||||
|
$bookmark_url =~ s/%I/$id/;
|
||||||
|
|
||||||
|
print $stdout "-- DEBUG: cordbookmark called with id=$id, url=$bookmark_url\n" if ($verbose);
|
||||||
|
my ($en, $em) = ¢ral_cd_dispatch("id=$id", $interactive, $bookmark_url);
|
||||||
|
print $stdout "-- DEBUG: central_cd_dispatch returned en=$en, em=$em\n" if ($verbose);
|
||||||
|
if ($interactive) {
|
||||||
|
if (!$en) {
|
||||||
|
print $stdout "-- bookmark $verb for post id #${id}: \"$text\"\n";
|
||||||
|
} else {
|
||||||
|
print $stdout "*** (was the bookmark already ${verb}?)\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $en;
|
||||||
|
}
|
||||||
|
|
||||||
# follow or unfollow a user
|
# follow or unfollow a user
|
||||||
sub foruuser {
|
sub foruuser {
|
||||||
my $uname = shift;
|
my $uname = shift;
|
||||||
@@ -8629,7 +8676,7 @@ sub defaultautocompletion {
|
|||||||
'/reply', '/url', '/thread', '/repost', '/replyall',
|
'/reply', '/url', '/thread', '/repost', '/replyall',
|
||||||
'/replies', '/timelines', '/timeline', '/visibility', '/ruler', '/exit', '/me', '/vcheck',
|
'/replies', '/timelines', '/timeline', '/visibility', '/ruler', '/exit', '/me', '/vcheck',
|
||||||
'/orepost', '/erepost', '/frepost', '/liston',
|
'/orepost', '/erepost', '/frepost', '/liston',
|
||||||
'/listoff', '/dmsent', '/boostsof', '/rtsof', '/rtson', '/rtsoff',
|
'/listoff', '/dmsent', '/boostsof', '/rtsof', '/bookmark', '/unbookmark', '/rtson', '/rtsoff',
|
||||||
'/lists', '/withlist', '/add', '/padd', '/push',
|
'/lists', '/withlist', '/add', '/padd', '/push',
|
||||||
'/pop', '/followers', '/following', '/friends', '/lfollow',
|
'/pop', '/followers', '/following', '/friends', '/lfollow',
|
||||||
'/lleave', '/listfollowers', '/listfriends',
|
'/lleave', '/listfollowers', '/listfriends',
|
||||||
|
|||||||
Reference in New Issue
Block a user