mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-03 22:16:54 +00:00
feat(global): major fixes...i dont even know that to call this commit so ill just say its global. Who even cares
This commit is contained in:
1 parent
f6395e4b8e
commit
104fda2c11
10 files changed
+22
-28
No files matched your search
@@ -60,8 +60,8 @@ class CallsService {
|
||||
transmitterSource: transmittingPlayer.source,
|
||||
receiver: receivingNumber,
|
||||
receiverSource: receivingPlayer.source,
|
||||
start: startCallTimeUnix,
|
||||
accepted: false,
|
||||
start: startCallTimeUnix.toString(),
|
||||
is_accepted: false,
|
||||
};
|
||||
|
||||
if (!receivingPlayer) {
|
||||
@@ -99,7 +99,7 @@ class CallsService {
|
||||
// We retrieve the call that was accepted from the current calls map
|
||||
const curCallAccepted = this.callMap.get(transmitterNumber);
|
||||
// We update its reference
|
||||
curCallAccepted.accepted = true;
|
||||
curCallAccepted.is_accepted = true;
|
||||
|
||||
const channelId = src;
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { matchLogger } from './match.utils';
|
||||
import MatchDB, { _MatchDB } from './match.db';
|
||||
import { Like, MatchEvents, Profile } from '../../../typings/match';
|
||||
import { getOrCreateProfile } from '../sv_match';
|
||||
import PlayerService from '../players/player.service';
|
||||
|
||||
class _MatchService {
|
||||
|
||||
@@ -6,7 +6,7 @@ export class PlayerRepo {
|
||||
const query = `SELECT ${config.database.identifierColumn} FROM ${config.database.playerTable} WHERE phone_number = ?`;
|
||||
const [results] = await pool.query(query, [phoneNumber]);
|
||||
// Get identifier from results
|
||||
return (results as { identifier: string }[])[0].identifier || null;
|
||||
return (results as any[])[0][config.database.identifierColumn] || null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -129,6 +129,7 @@ class _PlayerService {
|
||||
|
||||
playerLogger.info('NPWD Player Loaded!');
|
||||
playerLogger.debug(newPlayer);
|
||||
emitNet(PhoneEvents.ON_INIT, pSource);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,13 +34,15 @@ const formatTweets = (profileId: number) => (tweet: Tweet): Tweet => ({
|
||||
|
||||
export class _TwitterDB {
|
||||
/**
|
||||
* Retrieve the latest 100 tweets
|
||||
* Retrieve the latest 50 tweets
|
||||
* @param profileId - twitter profile id of the player
|
||||
*/
|
||||
async fetchAllTweets(profileId: number): Promise<Tweet[]> {
|
||||
const query = `
|
||||
SELECT ${SELECT_FIELDS}
|
||||
FROM npwd_twitter_tweets
|
||||
FROM (
|
||||
SELECT * FROM npwd_twitter_tweets ORDER BY id DESC LIMIT 50
|
||||
) npwd_twitter_tweets
|
||||
LEFT OUTER JOIN npwd_twitter_profiles
|
||||
ON npwd_twitter_tweets.identifier = npwd_twitter_profiles.identifier
|
||||
LEFT OUTER JOIN npwd_twitter_likes ON npwd_twitter_tweets.id = npwd_twitter_likes.tweet_id AND
|
||||
@@ -51,7 +53,6 @@ export class _TwitterDB {
|
||||
LEFT OUTER JOIN npwd_twitter_profiles AS retweets_profiles
|
||||
ON retweets.identifier = retweets_profiles.identifier
|
||||
WHERE npwd_twitter_tweets.visible = 1
|
||||
ORDER BY npwd_twitter_tweets.id DESC LIMIT 50
|
||||
`;
|
||||
const [results] = await pool.query(query, [profileId, profileId]);
|
||||
const tweets = <Tweet[]>results;
|
||||
|
||||
Reference in new issue
Block a user