diff options
author | mightymop <totzkotz@gmail.com> | 2022-03-03 23:22:45 +0300 |
---|---|---|
committer | mightymop <totzkotz@gmail.com> | 2022-03-03 23:22:45 +0300 |
commit | 419ef4764da750515fe61e8f21713f5bdb789cb1 (patch) | |
tree | bc256cb36a897dba4e28656e52defbc04d9c0516 | |
parent | bff792a6d0739c9c174f1ef72d2ad023938f89a6 (diff) |
fix: add option for auto answer user subscritionfix_muc1
-rw-r--r-- | src/OptionsDefault.ts | 2 | ||||
-rw-r--r-- | src/connection/services/Roster.ts | 15 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/OptionsDefault.ts b/src/OptionsDefault.ts index 85c57a02..26df4507 100644 --- a/src/OptionsDefault.ts +++ b/src/OptionsDefault.ts @@ -174,3 +174,5 @@ export let autoLoadOnScrollToTop = false; export let nominatimurl = 'https://nominatim.openstreetmap.org'; export let enableGeocode = true; + +export let autoAnswerSubscription = true; diff --git a/src/connection/services/Roster.ts b/src/connection/services/Roster.ts index 26833204..575aac90 100644 --- a/src/connection/services/Roster.ts +++ b/src/connection/services/Roster.ts @@ -2,6 +2,7 @@ import AbstractService from './AbstractService'; import { IJID } from '../../JID.interface'; import * as NS from '../xmpp/namespace'; import { $pres, $iq } from '../../vendor/Strophe'; +import Client from '@src/Client'; export default class Roster extends AbstractService { public getRoster(version?: string): Promise<Element> { @@ -41,6 +42,20 @@ export default class Roster extends AbstractService { this.sendSubscriptionRequest(jid); + /* + The following will fix an issue which was noticed on openfire where + 1. User A adds user B to roster. + 2. User B gets the friendship_request subcription notification and adds User A with the upcoming dialog. + 3. User A was added to User B's roster (green dot and colored rosteritem). + 4. But User B is grey and without the green dot on User A's roster although both are online. + + Maybe https://github.com/igniterealtime/Openfire/pull/2010 will make the following unnecessary + */ + let autoanswer = Client.getStorage().getItem('autoAnswerSubscription') || true; + if (autoanswer) { + this.sendSubscriptionAnswer(jid, true); + } + return waitForRoster; } |