Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/jsxc/jsxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormightymop <totzkotz@gmail.com>2022-03-03 23:22:45 +0300
committermightymop <totzkotz@gmail.com>2022-03-03 23:22:45 +0300
commit419ef4764da750515fe61e8f21713f5bdb789cb1 (patch)
treebc256cb36a897dba4e28656e52defbc04d9c0516
parentbff792a6d0739c9c174f1ef72d2ad023938f89a6 (diff)
fix: add option for auto answer user subscritionfix_muc1
-rw-r--r--src/OptionsDefault.ts2
-rw-r--r--src/connection/services/Roster.ts15
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;
}