Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
commit
c00c1c046f
4 changed files with 6 additions and 7 deletions
|
|
@ -56,8 +56,8 @@ export default definePlugin({
|
|||
{
|
||||
find: 'type:"user",revision',
|
||||
replacement: {
|
||||
match: /!(\i)&&"CONNECTION_OPEN".+?;/g,
|
||||
replace: "$1=!0;"
|
||||
match: /!(\i)(?=&&"CONNECTION_OPEN")/,
|
||||
replace: "!($1=true)"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -125,12 +125,11 @@ export default definePlugin({
|
|||
// Implicit relationships are defined as users that you:
|
||||
// 1. Have an affinity for
|
||||
// 2. Do not have a relationship with
|
||||
await this.refreshUserAffinities();
|
||||
const userAffinities: Record<string, any>[] = UserAffinitiesStore.getUserAffinities();
|
||||
const relationships = RelationshipStore.getMutableRelationships();
|
||||
const nonFriendAffinities = userAffinities.filter(a => !RelationshipStore.getRelationshipType(a.otherUserId));
|
||||
nonFriendAffinities.forEach(a => {
|
||||
relationships[a.otherUserId] = 5;
|
||||
relationships.set(a.otherUserId, 5);
|
||||
});
|
||||
RelationshipStore.emitChange();
|
||||
|
||||
|
|
|
|||
|
|
@ -173,8 +173,8 @@ export async function syncFriends() {
|
|||
friends.requests = [];
|
||||
|
||||
const relationShips = RelationshipStore.getMutableRelationships();
|
||||
for (const id in relationShips) {
|
||||
switch (relationShips[id]) {
|
||||
for (const [id, type] of relationShips) {
|
||||
switch (type) {
|
||||
case RelationshipType.FRIEND:
|
||||
friends.friends.push(id);
|
||||
break;
|
||||
|
|
|
|||
2
src/webpack/common/types/stores.d.ts
vendored
2
src/webpack/common/types/stores.d.ts
vendored
|
|
@ -294,5 +294,5 @@ export class RelationshipStore extends FluxStore {
|
|||
getSince(userId: string): string;
|
||||
|
||||
/** @returns Format: [userId: Enum value from constants.RelationshipTypes] */
|
||||
getMutableRelationships(): Record<number, number>;
|
||||
getMutableRelationships(): Map<string, number>;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue