feat: Remove Moxxy specific strings
This commit is contained in:
parent
5641b54f8f
commit
d5493a185a
@ -69,7 +69,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
RosterManager(),
|
RosterManager(),
|
||||||
PingManager(),
|
PingManager(),
|
||||||
MessageManager(),
|
MessageManager(),
|
||||||
PresenceManager(),
|
PresenceManager('http://moxxmpp.example'),
|
||||||
])
|
])
|
||||||
..registerFeatureNegotiators([
|
..registerFeatureNegotiators([
|
||||||
ResourceBindingNegotiator(),
|
ResourceBindingNegotiator(),
|
||||||
|
@ -1,26 +1,26 @@
|
|||||||
const smManager = 'im.moxxy.streammangementmanager';
|
const smManager = 'im.moxxmpp.streammangementmanager';
|
||||||
const discoManager = 'im.moxxy.discomanager';
|
const discoManager = 'im.moxxmpp.discomanager';
|
||||||
const messageManager = 'im.moxxy.messagemanager';
|
const messageManager = 'im.moxxmpp.messagemanager';
|
||||||
const rosterManager = 'im.moxxy.rostermanager';
|
const rosterManager = 'im.moxxmpp.rostermanager';
|
||||||
const presenceManager = 'im.moxxy.presencemanager';
|
const presenceManager = 'im.moxxmpp.presencemanager';
|
||||||
const csiManager = 'im.moxxy.csimanager';
|
const csiManager = 'im.moxxmpp.csimanager';
|
||||||
const carbonsManager = 'im.moxxy.carbonsmanager';
|
const carbonsManager = 'im.moxxmpp.carbonsmanager';
|
||||||
const vcardManager = 'im.moxxy.vcardmanager';
|
const vcardManager = 'im.moxxmpp.vcardmanager';
|
||||||
const pubsubManager = 'im.moxxy.pubsubmanager';
|
const pubsubManager = 'im.moxxmpp.pubsubmanager';
|
||||||
const userAvatarManager = 'im.moxxy.useravatarmanager';
|
const userAvatarManager = 'im.moxxmpp.useravatarmanager';
|
||||||
const stableIdManager = 'im.moxxy.stableidmanager';
|
const stableIdManager = 'im.moxxmpp.stableidmanager';
|
||||||
const simsManager = 'im.moxxy.simsmanager';
|
const simsManager = 'im.moxxmpp.simsmanager';
|
||||||
const messageDeliveryReceiptManager = 'im.moxxy.messagedeliveryreceiptmanager';
|
const messageDeliveryReceiptManager = 'im.moxxmpp.messagedeliveryreceiptmanager';
|
||||||
const chatMarkerManager = 'im.moxxy.chatmarkermanager';
|
const chatMarkerManager = 'im.moxxmpp.chatmarkermanager';
|
||||||
const oobManager = 'im.moxxy.oobmanager';
|
const oobManager = 'im.moxxmpp.oobmanager';
|
||||||
const sfsManager = 'im.moxxy.sfsmanager';
|
const sfsManager = 'im.moxxmpp.sfsmanager';
|
||||||
const messageRepliesManager = 'im.moxxy.messagerepliesmanager';
|
const messageRepliesManager = 'im.moxxmpp.messagerepliesmanager';
|
||||||
const blockingManager = 'im.moxxy.blockingmanager';
|
const blockingManager = 'im.moxxmpp.blockingmanager';
|
||||||
const httpFileUploadManager = 'im.moxxy.httpfileuploadmanager';
|
const httpFileUploadManager = 'im.moxxmpp.httpfileuploadmanager';
|
||||||
const chatStateManager = 'im.moxxy.chatstatemanager';
|
const chatStateManager = 'im.moxxmpp.chatstatemanager';
|
||||||
const pingManager = 'im.moxxy.ping';
|
const pingManager = 'im.moxxmpp.ping';
|
||||||
const fileUploadNotificationManager = 'im.moxxy.fileuploadnotificationmanager';
|
const fileUploadNotificationManager = 'im.moxxmpp.fileuploadnotificationmanager';
|
||||||
const omemoManager = 'org.moxxy.omemomanager';
|
const omemoManager = 'org.moxxmpp.omemomanager';
|
||||||
const emeManager = 'org.moxxy.ememanager';
|
const emeManager = 'org.moxxmpp.ememanager';
|
||||||
const cryptographicHashManager = 'org.moxxy.cryptographichashmanager';
|
const cryptographicHashManager = 'org.moxxmpp.cryptographichashmanager';
|
||||||
const delayedDeliveryManager = 'org.moxxy.delayeddeliverymanager';
|
const delayedDeliveryManager = 'org.moxxmpp.delayeddeliverymanager';
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
const saslPlainNegotiator = 'im.moxxy.sasl.plain';
|
const saslPlainNegotiator = 'im.moxxmpp.sasl.plain';
|
||||||
const saslScramSha1Negotiator = 'im.moxxy.sasl.scram.sha1';
|
const saslScramSha1Negotiator = 'im.moxxmpp.sasl.scram.sha1';
|
||||||
const saslScramSha256Negotiator = 'im.moxxy.sasl.scram.sha256';
|
const saslScramSha256Negotiator = 'im.moxxmpp.sasl.scram.sha256';
|
||||||
const saslScramSha512Negotiator = 'im.moxxy.sasl.scram.sha512';
|
const saslScramSha512Negotiator = 'im.moxxmpp.sasl.scram.sha512';
|
||||||
const csiNegotiator = 'im.moxxy.xeps.csi';
|
const csiNegotiator = 'im.moxxmpp.xeps.csi';
|
||||||
const rosterNegotiator = 'im.moxxy.core.roster';
|
const rosterNegotiator = 'im.moxxmpp.core.roster';
|
||||||
const resourceBindingNegotiator = 'im.moxxy.core.resource';
|
const resourceBindingNegotiator = 'im.moxxmpp.core.resource';
|
||||||
const streamManagementNegotiator = 'im.moxxy.xeps.sm';
|
const streamManagementNegotiator = 'im.moxxmpp.xeps.sm';
|
||||||
const startTlsNegotiator = 'im.moxxy.core.starttls';
|
const startTlsNegotiator = 'im.moxxmpp.core.starttls';
|
||||||
|
@ -14,9 +14,11 @@ import 'package:moxxmpp/src/xeps/xep_0115.dart';
|
|||||||
import 'package:moxxmpp/src/xeps/xep_0414.dart';
|
import 'package:moxxmpp/src/xeps/xep_0414.dart';
|
||||||
|
|
||||||
class PresenceManager extends XmppManagerBase {
|
class PresenceManager extends XmppManagerBase {
|
||||||
|
PresenceManager(this._capHashNode) : _capabilityHash = null, super();
|
||||||
PresenceManager() : _capabilityHash = null, super();
|
|
||||||
String? _capabilityHash;
|
String? _capabilityHash;
|
||||||
|
final String _capHashNode;
|
||||||
|
|
||||||
|
String get capabilityHashNode => _capHashNode;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String getId() => presenceManager;
|
String getId() => presenceManager;
|
||||||
@ -93,7 +95,7 @@ class PresenceManager extends XmppManagerBase {
|
|||||||
xmlns: capsXmlns,
|
xmlns: capsXmlns,
|
||||||
attributes: {
|
attributes: {
|
||||||
'hash': 'sha-1',
|
'hash': 'sha-1',
|
||||||
'node': 'http://moxxy.im',
|
'node': _capHashNode,
|
||||||
'ver': await getCapabilityHash()
|
'ver': await getCapabilityHash()
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -157,7 +157,7 @@ class DiscoManager extends XmppManagerBase {
|
|||||||
final query = stanza.firstTag('query')!;
|
final query = stanza.firstTag('query')!;
|
||||||
final node = query.attributes['node'] as String?;
|
final node = query.attributes['node'] as String?;
|
||||||
final capHash = await presence.getCapabilityHash();
|
final capHash = await presence.getCapabilityHash();
|
||||||
final isCapabilityNode = node == 'http://moxxy.im#$capHash';
|
final isCapabilityNode = node == '${presence.capabilityHashNode}#$capHash';
|
||||||
|
|
||||||
if (!isCapabilityNode && node != null) {
|
if (!isCapabilityNode && node != null) {
|
||||||
await getAttributes().sendStanza(Stanza.iq(
|
await getAttributes().sendStanza(Stanza.iq(
|
||||||
@ -200,7 +200,7 @@ class DiscoManager extends XmppManagerBase {
|
|||||||
xmlns: discoInfoXmlns,
|
xmlns: discoInfoXmlns,
|
||||||
attributes: {
|
attributes: {
|
||||||
...!isCapabilityNode ? {} : {
|
...!isCapabilityNode ? {} : {
|
||||||
'node': 'http://moxxy.im#$capHash'
|
'node': '${presence.capabilityHashNode}#$capHash'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
|
@ -60,7 +60,7 @@ void main() {
|
|||||||
StubNegotiator2(),
|
StubNegotiator2(),
|
||||||
])
|
])
|
||||||
..registerManagers([
|
..registerManagers([
|
||||||
PresenceManager(),
|
PresenceManager('http://moxxmpp.example'),
|
||||||
RosterManager(),
|
RosterManager(),
|
||||||
DiscoManager(),
|
DiscoManager(),
|
||||||
PingManager(),
|
PingManager(),
|
||||||
|
@ -53,7 +53,7 @@ void main() {
|
|||||||
ignoreId: true,
|
ignoreId: true,
|
||||||
),
|
),
|
||||||
StringExpectation(
|
StringExpectation(
|
||||||
"<presence xmlns='jabber:client' from='polynomdivision@test.server/MU29eEZn'><show>chat</show><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://moxxy.im' ver='QRTBC5cg/oYd+UOTYazSQR4zb/I=' /></presence>",
|
"<presence xmlns='jabber:client' from='polynomdivision@test.server/MU29eEZn'><show>chat</show><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://moxxmpp.example' ver='QRTBC5cg/oYd+UOTYazSQR4zb/I=' /></presence>",
|
||||||
'',
|
'',
|
||||||
),
|
),
|
||||||
StanzaExpectation(
|
StanzaExpectation(
|
||||||
@ -73,7 +73,7 @@ void main() {
|
|||||||
allowPlainAuth: true,
|
allowPlainAuth: true,
|
||||||
),);
|
),);
|
||||||
conn.registerManagers([
|
conn.registerManagers([
|
||||||
PresenceManager(),
|
PresenceManager('http://moxxmpp.example'),
|
||||||
RosterManager(),
|
RosterManager(),
|
||||||
DiscoManager(),
|
DiscoManager(),
|
||||||
PingManager(),
|
PingManager(),
|
||||||
|
@ -242,7 +242,7 @@ void main() {
|
|||||||
),);
|
),);
|
||||||
final sm = StreamManagementManager();
|
final sm = StreamManagementManager();
|
||||||
conn.registerManagers([
|
conn.registerManagers([
|
||||||
PresenceManager(),
|
PresenceManager('http://moxxmpp.example'),
|
||||||
RosterManager(),
|
RosterManager(),
|
||||||
DiscoManager(),
|
DiscoManager(),
|
||||||
PingManager(),
|
PingManager(),
|
||||||
@ -343,7 +343,7 @@ void main() {
|
|||||||
'<enabled xmlns="urn:xmpp:sm:3" id="some-long-sm-id" resume="true" />',
|
'<enabled xmlns="urn:xmpp:sm:3" id="some-long-sm-id" resume="true" />',
|
||||||
),
|
),
|
||||||
StringExpectation(
|
StringExpectation(
|
||||||
"<presence xmlns='jabber:client' from='polynomdivision@test.server/MU29eEZn'><show>chat</show><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://moxxy.im' ver='QRTBC5cg/oYd+UOTYazSQR4zb/I=' /></presence>",
|
"<presence xmlns='jabber:client' from='polynomdivision@test.server/MU29eEZn'><show>chat</show><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://moxxmpp.example' ver='QRTBC5cg/oYd+UOTYazSQR4zb/I=' /></presence>",
|
||||||
'<iq type="result" />',
|
'<iq type="result" />',
|
||||||
),
|
),
|
||||||
StanzaExpectation(
|
StanzaExpectation(
|
||||||
@ -364,7 +364,7 @@ void main() {
|
|||||||
),);
|
),);
|
||||||
final sm = StreamManagementManager();
|
final sm = StreamManagementManager();
|
||||||
conn.registerManagers([
|
conn.registerManagers([
|
||||||
PresenceManager(),
|
PresenceManager('http://moxxmpp.example'),
|
||||||
RosterManager(),
|
RosterManager(),
|
||||||
DiscoManager(),
|
DiscoManager(),
|
||||||
PingManager(),
|
PingManager(),
|
||||||
@ -518,7 +518,7 @@ void main() {
|
|||||||
allowPlainAuth: true,
|
allowPlainAuth: true,
|
||||||
),);
|
),);
|
||||||
conn.registerManagers([
|
conn.registerManagers([
|
||||||
PresenceManager(),
|
PresenceManager('http://moxxmpp.example'),
|
||||||
RosterManager(),
|
RosterManager(),
|
||||||
DiscoManager(),
|
DiscoManager(),
|
||||||
PingManager(),
|
PingManager(),
|
||||||
@ -610,7 +610,7 @@ void main() {
|
|||||||
allowPlainAuth: true,
|
allowPlainAuth: true,
|
||||||
),);
|
),);
|
||||||
conn.registerManagers([
|
conn.registerManagers([
|
||||||
PresenceManager(),
|
PresenceManager('http://moxxmpp.example'),
|
||||||
RosterManager(),
|
RosterManager(),
|
||||||
DiscoManager(),
|
DiscoManager(),
|
||||||
PingManager(),
|
PingManager(),
|
||||||
@ -702,7 +702,7 @@ void main() {
|
|||||||
allowPlainAuth: true,
|
allowPlainAuth: true,
|
||||||
),);
|
),);
|
||||||
conn.registerManagers([
|
conn.registerManagers([
|
||||||
PresenceManager(),
|
PresenceManager('http://moxxmpp.example'),
|
||||||
RosterManager(),
|
RosterManager(),
|
||||||
DiscoManager(),
|
DiscoManager(),
|
||||||
PingManager(),
|
PingManager(),
|
||||||
|
@ -104,7 +104,7 @@ void main() {
|
|||||||
attributes: {
|
attributes: {
|
||||||
// TODO: Somehow make the test ignore this attribute
|
// TODO: Somehow make the test ignore this attribute
|
||||||
'ver': 'QRTBC5cg/oYd+UOTYazSQR4zb/I=',
|
'ver': 'QRTBC5cg/oYd+UOTYazSQR4zb/I=',
|
||||||
'node': 'http://moxxy.im',
|
'node': 'http://moxxmpp.example',
|
||||||
'hash': 'sha-1'
|
'hash': 'sha-1'
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@ -126,7 +126,7 @@ void main() {
|
|||||||
allowPlainAuth: true,
|
allowPlainAuth: true,
|
||||||
),);
|
),);
|
||||||
conn.registerManagers([
|
conn.registerManagers([
|
||||||
PresenceManager(),
|
PresenceManager('http://moxxmpp.example'),
|
||||||
RosterManager(),
|
RosterManager(),
|
||||||
DiscoManager(),
|
DiscoManager(),
|
||||||
PingManager(),
|
PingManager(),
|
||||||
@ -180,7 +180,7 @@ void main() {
|
|||||||
allowPlainAuth: true,
|
allowPlainAuth: true,
|
||||||
),);
|
),);
|
||||||
conn.registerManagers([
|
conn.registerManagers([
|
||||||
PresenceManager(),
|
PresenceManager('http://moxxmpp.example'),
|
||||||
RosterManager(),
|
RosterManager(),
|
||||||
DiscoManager(),
|
DiscoManager(),
|
||||||
PingManager(),
|
PingManager(),
|
||||||
@ -234,7 +234,7 @@ void main() {
|
|||||||
allowPlainAuth: true,
|
allowPlainAuth: true,
|
||||||
),);
|
),);
|
||||||
conn.registerManagers([
|
conn.registerManagers([
|
||||||
PresenceManager(),
|
PresenceManager('http://moxxmpp.example'),
|
||||||
RosterManager(),
|
RosterManager(),
|
||||||
DiscoManager(),
|
DiscoManager(),
|
||||||
PingManager(),
|
PingManager(),
|
||||||
@ -289,7 +289,7 @@ void main() {
|
|||||||
allowPlainAuth: false,
|
allowPlainAuth: false,
|
||||||
),);
|
),);
|
||||||
conn.registerManagers([
|
conn.registerManagers([
|
||||||
PresenceManager(),
|
PresenceManager('http://moxxmpp.example'),
|
||||||
RosterManager(),
|
RosterManager(),
|
||||||
DiscoManager(),
|
DiscoManager(),
|
||||||
PingManager(),
|
PingManager(),
|
||||||
|
Loading…
Reference in New Issue
Block a user