Rebase DMs, updating for rename of 'scraper' to 'pkg/scraper'

This commit is contained in:
Alessio 2023-11-07 13:42:41 -04:00
parent f0fcef68e0
commit ef72de76e0
11 changed files with 50 additions and 5 deletions

View File

@ -76,7 +76,7 @@ func main() {
if len(args) < 2 {
if len(args) == 1 && (args[0] == "list_followed" || args[0] == "webserver" || args[0] == "fetch_timeline" ||
args[0] == "fetch_timeline_for_you" || args[0] == "fetch_inbox") {
args[0] == "fetch_timeline_for_you" || args[0] == "fetch_inbox") {
// Doesn't need a target, so create a fake second arg
args = append(args, "")
} else {

View File

@ -3,7 +3,7 @@ package persistence
import (
"fmt"
"offline_twitter/scraper"
"gitlab.com/offline-twitter/twitter_offline_engine/pkg/scraper"
)
func (p Profile) SaveChatRoom(r scraper.DMChatRoom) error {

View File

@ -7,7 +7,8 @@ import (
"github.com/go-test/deep"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"offline_twitter/scraper"
"gitlab.com/offline-twitter/twitter_offline_engine/pkg/scraper"
)
func TestSaveAndLoadChatRoom(t *testing.T) {

View File

@ -3,7 +3,7 @@ package persistence
import (
"fmt"
. "offline_twitter/scraper"
. "gitlab.com/offline-twitter/twitter_offline_engine/pkg/scraper"
)
// Convenience function that saves all the objects in a TweetTrove.

View File

@ -8,7 +8,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
. "offline_twitter/scraper"
. "gitlab.com/offline-twitter/twitter_offline_engine/pkg/scraper"
)
func TestParseAPIDMMessage(t *testing.T) {

View File

@ -313,6 +313,50 @@ insert into likes values(4, 4, 1178839081222115328, 1426669666928414720);
insert into likes values(5, 5, 1178839081222115328, 1698765208393576891);
create table chat_rooms (rowid integer primary key,
id text unique not null,
type text not null,
last_messaged_at integer not null,
is_nsfw boolean not null
);
create table chat_room_participants(rowid integer primary key,
chat_room_id text not null,
user_id integer not null,
last_read_event_id integer not null,
is_chat_settings_valid boolean not null default 0,
is_notifications_disabled boolean not null,
is_mention_notifications_disabled boolean not null,
is_read_only boolean not null,
is_trusted boolean not null,
is_muted boolean not null,
status text not null,
unique(chat_room_id, user_id)
);
create table chat_messages (rowid integer primary key,
id integer unique not null check(typeof(id) = 'integer'),
chat_room_id text not null,
sender_id integer not null,
sent_at integer not null,
request_id text not null,
in_reply_to_id integer,
text text not null,
foreign key(chat_room_id) references chat_rooms(id)
foreign key(sender_id) references users(id)
);
create table chat_message_reactions (rowid integer primary key,
id integer unique not null check(typeof(id) = 'integer'),
message_id integer not null,
sender_id integer not null,
sent_at integer not null,
emoji text not null check (length(emoji) = 1),
foreign key(message_id) references chat_messages(id)
foreign key(sender_id) references users(id)
);
create table fake_user_sequence(latest_fake_id integer not null);
insert into fake_user_sequence values(0x4000000000000000);