Skip to content

Commit ab21f09

Browse files
authored
Merge pull request #581 from lockdown-systems/427-tombstone
Tombstone feature for X
2 parents 0b69bbd + 19c0d51 commit ab21f09

25 files changed

Lines changed: 1169 additions & 13 deletions

src/database/migrations.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,5 +178,21 @@ export const runMainMigrations = () => {
178178
name: "add archiveOnly to xAccount table",
179179
sql: [`ALTER TABLE xAccount ADD COLUMN archiveOnly BOOLEAN DEFAULT 0;`],
180180
},
181+
// Add tombstone settings to xAccount table
182+
{
183+
name: "add tombstone settings to xAccount table",
184+
sql: [
185+
`ALTER TABLE xAccount ADD COLUMN bio TEXT;`,
186+
`ALTER TABLE xAccount ADD COLUMN tombstoneUpdateBanner BOOLEAN DEFAULT 1;`,
187+
`ALTER TABLE xAccount ADD COLUMN tombstoneUpdateBannerBackground TEXT DEFAULT 'night';`,
188+
`ALTER TABLE xAccount ADD COLUMN tombstoneUpdateBannerSocialIcons TEXT DEFAULT 'none';`,
189+
`ALTER TABLE xAccount ADD COLUMN tombstoneUpdateBannerShowText BOOLEAN DEFAULT 1;`,
190+
`ALTER TABLE xAccount ADD COLUMN tombstoneBannerDataURL TEXT DEFAULT '';`,
191+
`ALTER TABLE xAccount ADD COLUMN tombstoneUpdateBio BOOLEAN DEFAULT 1;`,
192+
`ALTER TABLE xAccount ADD COLUMN tombstoneUpdateBioText TEXT DEFAULT '';`,
193+
`ALTER TABLE xAccount ADD COLUMN tombstoneUpdateBioCreditCyd BOOLEAN DEFAULT 1;`,
194+
`ALTER TABLE xAccount ADD COLUMN tombstoneLockAccount BOOLEAN DEFAULT 1;`,
195+
],
196+
},
181197
]);
182198
};

src/database/x_account.ts

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ interface XAccountRow {
1010
accessedAt: string;
1111
username: string;
1212
userID: string;
13+
bio: string;
1314
profileImageDataURI: string;
1415
importFromArchive: boolean;
1516
saveMyData: boolean;
@@ -39,6 +40,15 @@ interface XAccountRow {
3940
tweetsCount: number;
4041
likesCount: number;
4142
archiveOnly: boolean;
43+
tombstoneUpdateBanner: boolean;
44+
tombstoneUpdateBannerBackground: string;
45+
tombstoneUpdateBannerSocialIcons: string;
46+
tombstoneUpdateBannerShowText: boolean;
47+
tombstoneBannerDataURL: string;
48+
tombstoneUpdateBio: boolean;
49+
tombstoneUpdateBioText: string;
50+
tombstoneUpdateBioCreditCyd: boolean;
51+
tombstoneLockAccount: boolean;
4252
}
4353

4454
function xAccountRowtoXAccount(row: XAccountRow): XAccount {
@@ -49,6 +59,7 @@ function xAccountRowtoXAccount(row: XAccountRow): XAccount {
4959
accessedAt: new Date(row.accessedAt),
5060
username: row.username,
5161
userID: row.userID,
62+
bio: row.bio,
5263
profileImageDataURI: row.profileImageDataURI,
5364
importFromArchive: !!row.importFromArchive,
5465
saveMyData: !!row.saveMyData,
@@ -79,6 +90,15 @@ function xAccountRowtoXAccount(row: XAccountRow): XAccount {
7990
tweetsCount: row.tweetsCount,
8091
likesCount: row.likesCount,
8192
archiveOnly: !!row.archiveOnly,
93+
tombstoneUpdateBanner: !!row.tombstoneUpdateBanner,
94+
tombstoneUpdateBannerBackground: row.tombstoneUpdateBannerBackground,
95+
tombstoneUpdateBannerSocialIcons: row.tombstoneUpdateBannerSocialIcons,
96+
tombstoneUpdateBannerShowText: !!row.tombstoneUpdateBannerShowText,
97+
tombstoneBannerDataURL: row.tombstoneBannerDataURL,
98+
tombstoneUpdateBio: !!row.tombstoneUpdateBio,
99+
tombstoneUpdateBioText: row.tombstoneUpdateBioText,
100+
tombstoneUpdateBioCreditCyd: !!row.tombstoneUpdateBioCreditCyd,
101+
tombstoneLockAccount: !!row.tombstoneLockAccount,
82102
};
83103
}
84104

@@ -135,6 +155,7 @@ export const saveXAccount = (account: XAccount) => {
135155
accessedAt = CURRENT_TIMESTAMP,
136156
username = ?,
137157
userID = ?,
158+
bio = ?,
138159
profileImageDataURI = ?,
139160
importFromArchive = ?,
140161
saveMyData = ?,
@@ -163,12 +184,22 @@ export const saveXAccount = (account: XAccount) => {
163184
followersCount = ?,
164185
tweetsCount = ?,
165186
likesCount = ?,
166-
archiveOnly = ?
187+
archiveOnly = ?,
188+
tombstoneUpdateBanner = ?,
189+
tombstoneUpdateBannerBackground = ?,
190+
tombstoneUpdateBannerSocialIcons = ?,
191+
tombstoneUpdateBannerShowText = ?,
192+
tombstoneBannerDataURL = ?,
193+
tombstoneUpdateBio = ?,
194+
tombstoneUpdateBioText = ?,
195+
tombstoneUpdateBioCreditCyd = ?,
196+
tombstoneLockAccount = ?
167197
WHERE id = ?
168198
`,
169199
[
170200
account.username,
171201
account.userID,
202+
account.bio,
172203
account.profileImageDataURI,
173204
account.importFromArchive ? 1 : 0,
174205
account.saveMyData ? 1 : 0,
@@ -198,6 +229,15 @@ export const saveXAccount = (account: XAccount) => {
198229
account.tweetsCount,
199230
account.likesCount,
200231
account.archiveOnly ? 1 : 0,
232+
account.tombstoneUpdateBanner ? 1 : 0,
233+
account.tombstoneUpdateBannerBackground,
234+
account.tombstoneUpdateBannerSocialIcons,
235+
account.tombstoneUpdateBannerShowText ? 1 : 0,
236+
account.tombstoneBannerDataURL,
237+
account.tombstoneUpdateBio ? 1 : 0,
238+
account.tombstoneUpdateBioText,
239+
account.tombstoneUpdateBioCreditCyd ? 1 : 0,
240+
account.tombstoneLockAccount ? 1 : 0,
201241
account.id,
202242
],
203243
);

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ async function createWindow() {
322322
);
323323
win = new BrowserWindow({
324324
width: 1000,
325-
height: 850,
325+
height: 900,
326326
minWidth: 900,
327327
minHeight: 700,
328328
webPreferences: {
44.3 KB
Loading
430 KB
Loading
418 KB
Loading
38.3 KB
Loading
27 KB
Loading
13.3 KB
Loading
27 KB
Loading

0 commit comments

Comments
 (0)