mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
Feature/Twitter Notification Filters (#147)
Feature: Twitter notification update
This commit is contained in:
15 files changed
+85
-23
No files matched your search
@@ -199,11 +199,12 @@ async function createDefaultProfile(identifier: string): Promise<Profile> {
|
||||
* not, create it and return it.
|
||||
* @param identifier - player's identifier
|
||||
*/
|
||||
async function getOrCreateProfile(identifier: string): Promise<Profile> {
|
||||
export async function getOrCreateProfile(identifier: string): Promise<Profile> {
|
||||
const profile = await getProfile(identifier);
|
||||
return profile || (await createDefaultProfile(identifier));
|
||||
}
|
||||
|
||||
|
||||
async function updateProfile(identifier: string, profile: Profile) {
|
||||
const { avatar_url, profile_name, bio, location, job } = profile;
|
||||
const query = `
|
||||
@@ -306,8 +307,9 @@ async function doesRetweetExist(tweetId: number, identifier: string): Promise<bo
|
||||
|
||||
onNet(events.TWITTER_GET_OR_CREATE_PROFILE, async () => {
|
||||
const _source = getSource();
|
||||
const identifier = getIdentifier(_source);
|
||||
|
||||
try {
|
||||
const identifier = getIdentifier(_source);
|
||||
const profile = await getOrCreateProfile(identifier);
|
||||
emitNet(events.TWITTER_GET_OR_CREATE_PROFILE_SUCCESS, _source, profile);
|
||||
} catch (e) {
|
||||
|
||||
Reference in new issue
Block a user