diff --git a/cmd/twitter/main.go b/cmd/twitter/main.go index f5c64d9..ae33445 100644 --- a/cmd/twitter/main.go +++ b/cmd/twitter/main.go @@ -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 { diff --git a/pkg/persistence/dm_queries.go b/pkg/persistence/dm_queries.go index 0e09e56..0bfffef 100644 --- a/pkg/persistence/dm_queries.go +++ b/pkg/persistence/dm_queries.go @@ -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 { diff --git a/pkg/persistence/dm_queries_test.go b/pkg/persistence/dm_queries_test.go index 380a088..3b25c78 100644 --- a/pkg/persistence/dm_queries_test.go +++ b/pkg/persistence/dm_queries_test.go @@ -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) { diff --git a/pkg/persistence/dm_trove_queries.go b/pkg/persistence/dm_trove_queries.go index d638e0c..9bc8226 100644 --- a/pkg/persistence/dm_trove_queries.go +++ b/pkg/persistence/dm_trove_queries.go @@ -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. diff --git a/pkg/scraper/api_types_dms_test.go b/pkg/scraper/api_types_dms_test.go index d424349..f85842c 100644 --- a/pkg/scraper/api_types_dms_test.go +++ b/pkg/scraper/api_types_dms_test.go @@ -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) { diff --git a/scraper/dm_trove.go b/pkg/scraper/dm_trove.go similarity index 100% rename from scraper/dm_trove.go rename to pkg/scraper/dm_trove.go diff --git a/scraper/test_responses/dms/dm_chat_room.json b/pkg/scraper/test_responses/dms/dm_chat_room.json similarity index 100% rename from scraper/test_responses/dms/dm_chat_room.json rename to pkg/scraper/test_responses/dms/dm_chat_room.json diff --git a/scraper/test_responses/dms/dm_message.json b/pkg/scraper/test_responses/dms/dm_message.json similarity index 100% rename from scraper/test_responses/dms/dm_message.json rename to pkg/scraper/test_responses/dms/dm_message.json diff --git a/scraper/test_responses/dms/dm_message_with_reacc.json b/pkg/scraper/test_responses/dms/dm_message_with_reacc.json similarity index 100% rename from scraper/test_responses/dms/dm_message_with_reacc.json rename to pkg/scraper/test_responses/dms/dm_message_with_reacc.json diff --git a/scraper/test_responses/dms/inbox.json b/pkg/scraper/test_responses/dms/inbox.json similarity index 100% rename from scraper/test_responses/dms/inbox.json rename to pkg/scraper/test_responses/dms/inbox.json diff --git a/sample_data/seed_data.sql b/sample_data/seed_data.sql index 1f25f5b..9a592c5 100644 --- a/sample_data/seed_data.sql +++ b/sample_data/seed_data.sql @@ -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);