fix(all): Fix linter warnings
This commit is contained in:
parent
fbe3b90200
commit
5f36289f50
@ -66,7 +66,7 @@ class MessageManager extends XmppManagerBase {
|
|||||||
stanzaTag: 'message',
|
stanzaTag: 'message',
|
||||||
callback: _onMessage,
|
callback: _onMessage,
|
||||||
priority: messageHandlerPriority,
|
priority: messageHandlerPriority,
|
||||||
)
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -66,7 +66,7 @@ class PresenceManager extends XmppManagerBase {
|
|||||||
stanzaTag: 'presence',
|
stanzaTag: 'presence',
|
||||||
callback: _onPresence,
|
callback: _onPresence,
|
||||||
priority: presenceHandlerPriority,
|
priority: presenceHandlerPriority,
|
||||||
)
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -122,7 +122,7 @@ class RosterManager extends XmppManagerBase {
|
|||||||
tagName: 'query',
|
tagName: 'query',
|
||||||
tagXmlns: rosterXmlns,
|
tagXmlns: rosterXmlns,
|
||||||
callback: _onRosterPush,
|
callback: _onRosterPush,
|
||||||
)
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -277,7 +277,7 @@ class RosterManager extends XmppManagerBase {
|
|||||||
attributes: {
|
attributes: {
|
||||||
'ver': await _stateManager.getRosterVersion() ?? '',
|
'ver': await _stateManager.getRosterVersion() ?? '',
|
||||||
},
|
},
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -319,14 +319,12 @@ class RosterManager extends XmppManagerBase {
|
|||||||
tag: 'item',
|
tag: 'item',
|
||||||
attributes: <String, String>{
|
attributes: <String, String>{
|
||||||
'jid': jid,
|
'jid': jid,
|
||||||
...title == jid.split('@')[0]
|
if (title == jid.split('@')[0]) 'name': title,
|
||||||
? <String, String>{}
|
|
||||||
: <String, String>{'name': title}
|
|
||||||
},
|
},
|
||||||
children: (groups ?? [])
|
children: (groups ?? [])
|
||||||
.map((group) => XMLNode(tag: 'group', text: group))
|
.map((group) => XMLNode(tag: 'group', text: group))
|
||||||
.toList(),
|
.toList(),
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -357,13 +355,13 @@ class RosterManager extends XmppManagerBase {
|
|||||||
children: [
|
children: [
|
||||||
XMLNode(
|
XMLNode(
|
||||||
tag: 'item',
|
tag: 'item',
|
||||||
attributes: <String, String>{
|
attributes: {
|
||||||
'jid': jid,
|
'jid': jid,
|
||||||
'subscription': 'remove'
|
'subscription': 'remove',
|
||||||
},
|
},
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -248,15 +248,14 @@ XMLNode buildErrorElement(String type, String condition, {String? text}) {
|
|||||||
XMLNode.xmlns(
|
XMLNode.xmlns(
|
||||||
tag: condition,
|
tag: condition,
|
||||||
xmlns: fullStanzaXmlns,
|
xmlns: fullStanzaXmlns,
|
||||||
children: text != null
|
children: [
|
||||||
? [
|
if (text != null)
|
||||||
XMLNode.xmlns(
|
XMLNode.xmlns(
|
||||||
tag: 'text',
|
tag: 'text',
|
||||||
xmlns: fullStanzaXmlns,
|
xmlns: fullStanzaXmlns,
|
||||||
text: text,
|
text: text,
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
: [],
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
@ -10,14 +10,14 @@ class DataFormOption {
|
|||||||
XMLNode toXml() {
|
XMLNode toXml() {
|
||||||
return XMLNode(
|
return XMLNode(
|
||||||
tag: 'option',
|
tag: 'option',
|
||||||
attributes: label != null
|
attributes: {
|
||||||
? <String, dynamic>{'label': label}
|
if (label != null) 'label': label,
|
||||||
: <String, dynamic>{},
|
},
|
||||||
children: [
|
children: [
|
||||||
XMLNode(
|
XMLNode(
|
||||||
tag: 'value',
|
tag: 'value',
|
||||||
text: value,
|
text: value,
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -45,19 +45,22 @@ class DataFormField {
|
|||||||
return XMLNode(
|
return XMLNode(
|
||||||
tag: 'field',
|
tag: 'field',
|
||||||
attributes: <String, dynamic>{
|
attributes: <String, dynamic>{
|
||||||
...varAttr != null
|
if (varAttr != null) 'var': varAttr,
|
||||||
? <String, dynamic>{'var': varAttr}
|
if (type != null) 'type': type,
|
||||||
: <String, dynamic>{},
|
if (label != null) 'label': label,
|
||||||
...type != null ? <String, dynamic>{'type': type} : <String, dynamic>{},
|
|
||||||
...label != null
|
|
||||||
? <String, dynamic>{'label': label}
|
|
||||||
: <String, dynamic>{}
|
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
...description != null ? [XMLNode(tag: 'desc', text: description)] : [],
|
if (description != null)
|
||||||
...isRequired ? [XMLNode(tag: 'required')] : [],
|
XMLNode(
|
||||||
|
tag: 'desc',
|
||||||
|
text: description,
|
||||||
|
),
|
||||||
|
if (isRequired)
|
||||||
|
XMLNode(
|
||||||
|
tag: 'required',
|
||||||
|
),
|
||||||
...values.map((value) => XMLNode(tag: 'value', text: value)),
|
...values.map((value) => XMLNode(tag: 'value', text: value)),
|
||||||
...options.map((option) => option.toXml())
|
...options.map((option) => option.toXml()),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -13,8 +13,10 @@ Stanza buildDiscoInfoQueryStanza(JID entity, String? node) {
|
|||||||
XMLNode.xmlns(
|
XMLNode.xmlns(
|
||||||
tag: 'query',
|
tag: 'query',
|
||||||
xmlns: discoInfoXmlns,
|
xmlns: discoInfoXmlns,
|
||||||
attributes: node != null ? {'node': node} : {},
|
attributes: {
|
||||||
)
|
if (node != null) 'node': node,
|
||||||
|
},
|
||||||
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -27,8 +29,10 @@ Stanza buildDiscoItemsQueryStanza(JID entity, {String? node}) {
|
|||||||
XMLNode.xmlns(
|
XMLNode.xmlns(
|
||||||
tag: 'query',
|
tag: 'query',
|
||||||
xmlns: discoItemsXmlns,
|
xmlns: discoItemsXmlns,
|
||||||
attributes: node != null ? {'node': node} : {},
|
attributes: {
|
||||||
)
|
if (node != null) 'node': node,
|
||||||
|
},
|
||||||
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -19,13 +19,11 @@ class Identity {
|
|||||||
XMLNode toXMLNode() {
|
XMLNode toXMLNode() {
|
||||||
return XMLNode(
|
return XMLNode(
|
||||||
tag: 'identity',
|
tag: 'identity',
|
||||||
attributes: <String, dynamic>{
|
attributes: {
|
||||||
'category': category,
|
'category': category,
|
||||||
'type': type,
|
'type': type,
|
||||||
'name': name,
|
'name': name,
|
||||||
...lang == null
|
if (lang != null) 'xml:lang': lang,
|
||||||
? <String, dynamic>{}
|
|
||||||
: <String, dynamic>{'xml:lang': lang}
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ class VCardManager extends XmppManagerBase {
|
|||||||
tagName: 'x',
|
tagName: 'x',
|
||||||
tagXmlns: vCardTempUpdate,
|
tagXmlns: vCardTempUpdate,
|
||||||
callback: _onPresence,
|
callback: _onPresence,
|
||||||
)
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -108,7 +108,7 @@ class VCardManager extends XmppManagerBase {
|
|||||||
XMLNode.xmlns(
|
XMLNode.xmlns(
|
||||||
tag: 'vCard',
|
tag: 'vCard',
|
||||||
xmlns: vCardTempXmlns,
|
xmlns: vCardTempXmlns,
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
encrypted: true,
|
encrypted: true,
|
||||||
|
@ -38,26 +38,20 @@ class PubSubPublishOptions {
|
|||||||
varAttr: 'FORM_TYPE',
|
varAttr: 'FORM_TYPE',
|
||||||
type: 'hidden',
|
type: 'hidden',
|
||||||
),
|
),
|
||||||
...accessModel != null
|
if (accessModel != null)
|
||||||
? [
|
DataFormField(
|
||||||
DataFormField(
|
options: [],
|
||||||
options: [],
|
isRequired: false,
|
||||||
isRequired: false,
|
values: [accessModel!],
|
||||||
values: [accessModel!],
|
varAttr: 'pubsub#access_model',
|
||||||
varAttr: 'pubsub#access_model',
|
),
|
||||||
)
|
if (maxItems != null)
|
||||||
]
|
DataFormField(
|
||||||
: [],
|
options: [],
|
||||||
...maxItems != null
|
isRequired: false,
|
||||||
? [
|
values: [maxItems!],
|
||||||
DataFormField(
|
varAttr: 'pubsub#max_items',
|
||||||
options: [],
|
),
|
||||||
isRequired: false,
|
|
||||||
values: [maxItems!],
|
|
||||||
varAttr: 'pubsub#max_items',
|
|
||||||
),
|
|
||||||
]
|
|
||||||
: [],
|
|
||||||
],
|
],
|
||||||
).toXml();
|
).toXml();
|
||||||
}
|
}
|
||||||
@ -87,7 +81,7 @@ class PubSubManager extends XmppManagerBase {
|
|||||||
tagName: 'event',
|
tagName: 'event',
|
||||||
tagXmlns: pubsubEventXmlns,
|
tagXmlns: pubsubEventXmlns,
|
||||||
callback: _onPubsubMessage,
|
callback: _onPubsubMessage,
|
||||||
)
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -314,11 +308,11 @@ class PubSubManager extends XmppManagerBase {
|
|||||||
children: [
|
children: [
|
||||||
XMLNode(
|
XMLNode(
|
||||||
tag: 'item',
|
tag: 'item',
|
||||||
attributes: id != null
|
attributes: {
|
||||||
? <String, String>{'id': id}
|
if (id != null) 'id': id,
|
||||||
: <String, String>{},
|
},
|
||||||
children: [payload],
|
children: [payload],
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (pubOptions != null)
|
if (pubOptions != null)
|
||||||
@ -327,7 +321,7 @@ class PubSubManager extends XmppManagerBase {
|
|||||||
children: [pubOptions.toXml()],
|
children: [pubOptions.toXml()],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
shouldEncrypt: false,
|
shouldEncrypt: false,
|
||||||
@ -422,7 +416,7 @@ class PubSubManager extends XmppManagerBase {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
shouldEncrypt: false,
|
shouldEncrypt: false,
|
||||||
|
@ -45,7 +45,7 @@ class OOBManager extends XmppManagerBase {
|
|||||||
callback: _onMessage,
|
callback: _onMessage,
|
||||||
// Before the message manager
|
// Before the message manager
|
||||||
priority: -99,
|
priority: -99,
|
||||||
)
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -69,7 +69,7 @@ class ChatStateManager extends XmppManagerBase {
|
|||||||
callback: _onChatStateReceived,
|
callback: _onChatStateReceived,
|
||||||
// Before the message handler
|
// Before the message handler
|
||||||
priority: -99,
|
priority: -99,
|
||||||
)
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -66,7 +66,7 @@ class MessageDeliveryReceiptManager extends XmppManagerBase {
|
|||||||
callback: _onDeliveryRequestReceived,
|
callback: _onDeliveryRequestReceived,
|
||||||
// Before the message handler
|
// Before the message handler
|
||||||
priority: -99,
|
priority: -99,
|
||||||
)
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -27,7 +27,7 @@ class BlockingManager extends XmppManagerBase {
|
|||||||
tagName: 'block',
|
tagName: 'block',
|
||||||
tagXmlns: blockingXmlns,
|
tagXmlns: blockingXmlns,
|
||||||
callback: _blockPush,
|
callback: _blockPush,
|
||||||
)
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -107,10 +107,12 @@ class BlockingManager extends XmppManagerBase {
|
|||||||
children: items.map((item) {
|
children: items.map((item) {
|
||||||
return XMLNode(
|
return XMLNode(
|
||||||
tag: 'item',
|
tag: 'item',
|
||||||
attributes: <String, String>{'jid': item},
|
attributes: {
|
||||||
|
'jid': item,
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}).toList(),
|
}).toList(),
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -128,7 +130,7 @@ class BlockingManager extends XmppManagerBase {
|
|||||||
XMLNode.xmlns(
|
XMLNode.xmlns(
|
||||||
tag: 'unblock',
|
tag: 'unblock',
|
||||||
xmlns: blockingXmlns,
|
xmlns: blockingXmlns,
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -152,11 +154,13 @@ class BlockingManager extends XmppManagerBase {
|
|||||||
.map(
|
.map(
|
||||||
(item) => XMLNode(
|
(item) => XMLNode(
|
||||||
tag: 'item',
|
tag: 'item',
|
||||||
attributes: <String, String>{'jid': item},
|
attributes: {
|
||||||
|
'jid': item,
|
||||||
|
},
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.toList(),
|
.toList(),
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -174,7 +178,7 @@ class BlockingManager extends XmppManagerBase {
|
|||||||
XMLNode.xmlns(
|
XMLNode.xmlns(
|
||||||
tag: 'blocklist',
|
tag: 'blocklist',
|
||||||
xmlns: blockingXmlns,
|
xmlns: blockingXmlns,
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -5,7 +5,10 @@ class StreamManagementEnableNonza extends XMLNode {
|
|||||||
StreamManagementEnableNonza()
|
StreamManagementEnableNonza()
|
||||||
: super(
|
: super(
|
||||||
tag: 'enable',
|
tag: 'enable',
|
||||||
attributes: <String, String>{'xmlns': smXmlns, 'resume': 'true'},
|
attributes: {
|
||||||
|
'xmlns': smXmlns,
|
||||||
|
'resume': 'true',
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -13,10 +16,10 @@ class StreamManagementResumeNonza extends XMLNode {
|
|||||||
StreamManagementResumeNonza(String id, int h)
|
StreamManagementResumeNonza(String id, int h)
|
||||||
: super(
|
: super(
|
||||||
tag: 'resume',
|
tag: 'resume',
|
||||||
attributes: <String, String>{
|
attributes: {
|
||||||
'xmlns': smXmlns,
|
'xmlns': smXmlns,
|
||||||
'previd': id,
|
'previd': id,
|
||||||
'h': h.toString()
|
'h': h.toString(),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -25,7 +28,10 @@ class StreamManagementAckNonza extends XMLNode {
|
|||||||
StreamManagementAckNonza(int h)
|
StreamManagementAckNonza(int h)
|
||||||
: super(
|
: super(
|
||||||
tag: 'a',
|
tag: 'a',
|
||||||
attributes: <String, String>{'xmlns': smXmlns, 'h': h.toString()},
|
attributes: {
|
||||||
|
'xmlns': smXmlns,
|
||||||
|
'h': h.toString(),
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -33,7 +39,7 @@ class StreamManagementRequestNonza extends XMLNode {
|
|||||||
StreamManagementRequestNonza()
|
StreamManagementRequestNonza()
|
||||||
: super(
|
: super(
|
||||||
tag: 'r',
|
tag: 'r',
|
||||||
attributes: <String, String>{
|
attributes: {
|
||||||
'xmlns': smXmlns,
|
'xmlns': smXmlns,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
@ -140,7 +140,7 @@ class StreamManagementManager extends XmppManagerBase {
|
|||||||
nonzaTag: 'a',
|
nonzaTag: 'a',
|
||||||
nonzaXmlns: smXmlns,
|
nonzaXmlns: smXmlns,
|
||||||
callback: _handleAckResponse,
|
callback: _handleAckResponse,
|
||||||
)
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -148,14 +148,14 @@ class StreamManagementManager extends XmppManagerBase {
|
|||||||
StanzaHandler(
|
StanzaHandler(
|
||||||
callback: _onServerStanzaReceived,
|
callback: _onServerStanzaReceived,
|
||||||
priority: 9999,
|
priority: 9999,
|
||||||
)
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<StanzaHandler> getOutgoingPostStanzaHandlers() => [
|
List<StanzaHandler> getOutgoingPostStanzaHandlers() => [
|
||||||
StanzaHandler(
|
StanzaHandler(
|
||||||
callback: _onClientStanzaSent,
|
callback: _onClientStanzaSent,
|
||||||
)
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -49,7 +49,7 @@ class CarbonsManager extends XmppManagerBase {
|
|||||||
tagXmlns: carbonsXmlns,
|
tagXmlns: carbonsXmlns,
|
||||||
callback: _onMessageSent,
|
callback: _onMessageSent,
|
||||||
priority: -98,
|
priority: -98,
|
||||||
)
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -124,7 +124,7 @@ class CarbonsManager extends XmppManagerBase {
|
|||||||
XMLNode.xmlns(
|
XMLNode.xmlns(
|
||||||
tag: 'enable',
|
tag: 'enable',
|
||||||
xmlns: carbonsXmlns,
|
xmlns: carbonsXmlns,
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -154,7 +154,7 @@ class CarbonsManager extends XmppManagerBase {
|
|||||||
XMLNode.xmlns(
|
XMLNode.xmlns(
|
||||||
tag: 'disable',
|
tag: 'disable',
|
||||||
xmlns: carbonsXmlns,
|
xmlns: carbonsXmlns,
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -40,7 +40,7 @@ class LastMessageCorrectionManager extends XmppManagerBase {
|
|||||||
callback: _onMessage,
|
callback: _onMessage,
|
||||||
// Before the message handler
|
// Before the message handler
|
||||||
priority: -99,
|
priority: -99,
|
||||||
)
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -100,7 +100,7 @@ class ChatMarkerManager extends XmppManagerBase {
|
|||||||
callback: _onMessage,
|
callback: _onMessage,
|
||||||
// Before the message handler
|
// Before the message handler
|
||||||
priority: -99,
|
priority: -99,
|
||||||
)
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -81,7 +81,7 @@ class StableIdManager extends XmppManagerBase {
|
|||||||
callback: _onMessage,
|
callback: _onMessage,
|
||||||
// Before the MessageManager
|
// Before the MessageManager
|
||||||
priority: -99,
|
priority: -99,
|
||||||
)
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -161,9 +161,9 @@ class HttpFileUploadManager extends XmppManagerBase {
|
|||||||
attributes: {
|
attributes: {
|
||||||
'filename': filename,
|
'filename': filename,
|
||||||
'size': filesize.toString(),
|
'size': filesize.toString(),
|
||||||
...contentType != null ? {'content-type': contentType} : {}
|
if (contentType != null) 'content-type': contentType,
|
||||||
},
|
},
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -82,7 +82,7 @@ class SIMSManager extends XmppManagerBase {
|
|||||||
tagXmlns: referenceXmlns,
|
tagXmlns: referenceXmlns,
|
||||||
// Before the message handler
|
// Before the message handler
|
||||||
priority: -99,
|
priority: -99,
|
||||||
)
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -31,7 +31,7 @@ class MessageRetractionManager extends XmppManagerBase {
|
|||||||
callback: _onMessage,
|
callback: _onMessage,
|
||||||
// Before the MessageManager
|
// Before the MessageManager
|
||||||
priority: -99,
|
priority: -99,
|
||||||
)
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -133,7 +133,7 @@ class SFSManager extends XmppManagerBase {
|
|||||||
callback: _onMessage,
|
callback: _onMessage,
|
||||||
// Before the message handler
|
// Before the message handler
|
||||||
priority: -98,
|
priority: -98,
|
||||||
)
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -96,7 +96,7 @@ class MessageRepliesManager extends XmppManagerBase {
|
|||||||
callback: _onMessage,
|
callback: _onMessage,
|
||||||
// Before the message handler
|
// Before the message handler
|
||||||
priority: -99,
|
priority: -99,
|
||||||
)
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -14,9 +14,9 @@ final scramSha1StreamFeatures = XMLNode(
|
|||||||
XMLNode(
|
XMLNode(
|
||||||
tag: 'mechanism',
|
tag: 'mechanism',
|
||||||
text: 'SCRAM-SHA-1',
|
text: 'SCRAM-SHA-1',
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
final scramSha256StreamFeatures = XMLNode(
|
final scramSha256StreamFeatures = XMLNode(
|
||||||
@ -29,9 +29,9 @@ final scramSha256StreamFeatures = XMLNode(
|
|||||||
XMLNode(
|
XMLNode(
|
||||||
tag: 'mechanism',
|
tag: 'mechanism',
|
||||||
text: 'SCRAM-SHA-256',
|
text: 'SCRAM-SHA-256',
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -171,7 +171,7 @@ void main() {
|
|||||||
),
|
),
|
||||||
tagName: '3',
|
tagName: '3',
|
||||||
priority: 50,
|
priority: 50,
|
||||||
)
|
),
|
||||||
]..sort(stanzaHandlerSortComparator);
|
]..sort(stanzaHandlerSortComparator);
|
||||||
|
|
||||||
expect(handlerList[0].tagName, '1');
|
expect(handlerList[0].tagName, '1');
|
||||||
|
@ -158,7 +158,7 @@ void main() {
|
|||||||
</iq>''',
|
</iq>''',
|
||||||
ignoreId: true,
|
ignoreId: true,
|
||||||
adjustId: true,
|
adjustId: true,
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ class StubbedDiscoManager extends DiscoManager {
|
|||||||
isRequired: false,
|
isRequired: false,
|
||||||
varAttr: 'FORM_TYPE',
|
varAttr: 'FORM_TYPE',
|
||||||
type: 'hidden',
|
type: 'hidden',
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
reported: [],
|
reported: [],
|
||||||
items: [],
|
items: [],
|
||||||
@ -153,14 +153,14 @@ void main() {
|
|||||||
'http://jabber.org/protocol/caps',
|
'http://jabber.org/protocol/caps',
|
||||||
'http://jabber.org/protocol/disco#info',
|
'http://jabber.org/protocol/disco#info',
|
||||||
'http://jabber.org/protocol/disco#items',
|
'http://jabber.org/protocol/disco#items',
|
||||||
'http://jabber.org/protocol/muc'
|
'http://jabber.org/protocol/muc',
|
||||||
],
|
],
|
||||||
const [
|
const [
|
||||||
Identity(
|
Identity(
|
||||||
category: 'client',
|
category: 'client',
|
||||||
type: 'pc',
|
type: 'pc',
|
||||||
name: 'Exodus 0.9.1',
|
name: 'Exodus 0.9.1',
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
const [],
|
const [],
|
||||||
null,
|
null,
|
||||||
@ -179,7 +179,7 @@ void main() {
|
|||||||
'http://jabber.org/protocol/caps',
|
'http://jabber.org/protocol/caps',
|
||||||
'http://jabber.org/protocol/disco#info',
|
'http://jabber.org/protocol/disco#info',
|
||||||
'http://jabber.org/protocol/disco#items',
|
'http://jabber.org/protocol/disco#items',
|
||||||
'http://jabber.org/protocol/muc'
|
'http://jabber.org/protocol/muc',
|
||||||
],
|
],
|
||||||
const [
|
const [
|
||||||
Identity(
|
Identity(
|
||||||
@ -295,14 +295,14 @@ void main() {
|
|||||||
'urn:xmpp:message-correct:0',
|
'urn:xmpp:message-correct:0',
|
||||||
'urn:xmpp:ping',
|
'urn:xmpp:ping',
|
||||||
'urn:xmpp:receipts',
|
'urn:xmpp:receipts',
|
||||||
'urn:xmpp:time'
|
'urn:xmpp:time',
|
||||||
],
|
],
|
||||||
const [
|
const [
|
||||||
Identity(
|
Identity(
|
||||||
category: 'client',
|
category: 'client',
|
||||||
type: 'phone',
|
type: 'phone',
|
||||||
name: 'Conversations',
|
name: 'Conversations',
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
const [],
|
const [],
|
||||||
null,
|
null,
|
||||||
|
@ -433,10 +433,11 @@ void main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('Test a failed stream resumption', () async {
|
test('Test a failed stream resumption', () async {
|
||||||
final fakeSocket = StubTCPSocket([
|
final fakeSocket = StubTCPSocket(
|
||||||
StringExpectation(
|
[
|
||||||
"<stream:stream xmlns='jabber:client' version='1.0' xmlns:stream='http://etherx.jabber.org/streams' to='test.server' from='polynomdivision@test.server' xml:lang='en'>",
|
StringExpectation(
|
||||||
'''
|
"<stream:stream xmlns='jabber:client' version='1.0' xmlns:stream='http://etherx.jabber.org/streams' to='test.server' from='polynomdivision@test.server' xml:lang='en'>",
|
||||||
|
'''
|
||||||
<stream:stream
|
<stream:stream
|
||||||
xmlns="jabber:client"
|
xmlns="jabber:client"
|
||||||
version="1.0"
|
version="1.0"
|
||||||
@ -448,14 +449,14 @@ void main() {
|
|||||||
<mechanism>PLAIN</mechanism>
|
<mechanism>PLAIN</mechanism>
|
||||||
</mechanisms>
|
</mechanisms>
|
||||||
</stream:features>''',
|
</stream:features>''',
|
||||||
),
|
),
|
||||||
StringExpectation(
|
StringExpectation(
|
||||||
"<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AHBvbHlub21kaXZpc2lvbgBhYWFh</auth>",
|
"<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AHBvbHlub21kaXZpc2lvbgBhYWFh</auth>",
|
||||||
'<success xmlns="urn:ietf:params:xml:ns:xmpp-sasl" />',
|
'<success xmlns="urn:ietf:params:xml:ns:xmpp-sasl" />',
|
||||||
),
|
),
|
||||||
StringExpectation(
|
StringExpectation(
|
||||||
"<stream:stream xmlns='jabber:client' version='1.0' xmlns:stream='http://etherx.jabber.org/streams' to='test.server' from='polynomdivision@test.server' xml:lang='en'>",
|
"<stream:stream xmlns='jabber:client' version='1.0' xmlns:stream='http://etherx.jabber.org/streams' to='test.server' from='polynomdivision@test.server' xml:lang='en'>",
|
||||||
'''
|
'''
|
||||||
<stream:stream
|
<stream:stream
|
||||||
xmlns="jabber:client"
|
xmlns="jabber:client"
|
||||||
version="1.0"
|
version="1.0"
|
||||||
@ -473,21 +474,22 @@ void main() {
|
|||||||
<sm xmlns="urn:xmpp:sm:3"/>
|
<sm xmlns="urn:xmpp:sm:3"/>
|
||||||
</stream:features>
|
</stream:features>
|
||||||
''',
|
''',
|
||||||
),
|
),
|
||||||
StringExpectation(
|
StringExpectation(
|
||||||
"<resume xmlns='urn:xmpp:sm:3' previd='id-1' h='10' />",
|
"<resume xmlns='urn:xmpp:sm:3' previd='id-1' h='10' />",
|
||||||
"<failed xmlns='urn:xmpp:sm:3' h='another-sequence-number'><item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></failed>",
|
"<failed xmlns='urn:xmpp:sm:3' h='another-sequence-number'><item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></failed>",
|
||||||
),
|
),
|
||||||
StanzaExpectation(
|
StanzaExpectation(
|
||||||
'<iq xmlns="jabber:client" type="set" id="a"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/></iq>',
|
'<iq xmlns="jabber:client" type="set" id="a"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/></iq>',
|
||||||
'<iq xmlns="jabber:client" type="result" id="a"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><jid>polynomdivision@test.server/MU29eEZn</jid></bind></iq>',
|
'<iq xmlns="jabber:client" type="result" id="a"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><jid>polynomdivision@test.server/MU29eEZn</jid></bind></iq>',
|
||||||
ignoreId: true,
|
ignoreId: true,
|
||||||
),
|
),
|
||||||
StringExpectation(
|
StringExpectation(
|
||||||
"<enable xmlns='urn:xmpp:sm:3' resume='true' />",
|
"<enable xmlns='urn:xmpp:sm:3' resume='true' />",
|
||||||
'<enabled xmlns="urn:xmpp:sm:3" id="id-2" resume="true" />',
|
'<enabled xmlns="urn:xmpp:sm:3" id="id-2" resume="true" />',
|
||||||
)
|
),
|
||||||
]);
|
],
|
||||||
|
);
|
||||||
|
|
||||||
final conn = XmppConnection(
|
final conn = XmppConnection(
|
||||||
TestingReconnectionPolicy(),
|
TestingReconnectionPolicy(),
|
||||||
|
@ -115,17 +115,19 @@ void main() {
|
|||||||
test('Test sending a message processing hint', () async {
|
test('Test sending a message processing hint', () async {
|
||||||
final manager = MessageManager();
|
final manager = MessageManager();
|
||||||
final holder = TestingManagerHolder(
|
final holder = TestingManagerHolder(
|
||||||
stubSocket: StubTCPSocket([
|
stubSocket: StubTCPSocket(
|
||||||
StanzaExpectation(
|
[
|
||||||
'''
|
StanzaExpectation(
|
||||||
|
'''
|
||||||
<message to="user@example.org" type="chat">
|
<message to="user@example.org" type="chat">
|
||||||
<no-copy xmlns="urn:xmpp:hints"/>
|
<no-copy xmlns="urn:xmpp:hints"/>
|
||||||
<no-store xmlns="urn:xmpp:hints"/>
|
<no-store xmlns="urn:xmpp:hints"/>
|
||||||
</message>
|
</message>
|
||||||
''',
|
''',
|
||||||
'',
|
'',
|
||||||
)
|
),
|
||||||
]),
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
await holder.register([
|
await holder.register([
|
||||||
|
@ -6,7 +6,7 @@ void main() {
|
|||||||
test('invariance', () {
|
test('invariance', () {
|
||||||
final headers = {
|
final headers = {
|
||||||
'authorization': 'Basic Base64String==',
|
'authorization': 'Basic Base64String==',
|
||||||
'cookie': 'foo=bar; user=romeo'
|
'cookie': 'foo=bar; user=romeo',
|
||||||
};
|
};
|
||||||
expect(
|
expect(
|
||||||
prepareHeaders(headers),
|
prepareHeaders(headers),
|
||||||
@ -16,7 +16,7 @@ void main() {
|
|||||||
test('invariance through uppercase', () {
|
test('invariance through uppercase', () {
|
||||||
final headers = {
|
final headers = {
|
||||||
'Authorization': 'Basic Base64String==',
|
'Authorization': 'Basic Base64String==',
|
||||||
'Cookie': 'foo=bar; user=romeo'
|
'Cookie': 'foo=bar; user=romeo',
|
||||||
};
|
};
|
||||||
expect(
|
expect(
|
||||||
prepareHeaders(headers),
|
prepareHeaders(headers),
|
||||||
@ -27,7 +27,7 @@ void main() {
|
|||||||
final headers = {
|
final headers = {
|
||||||
'Authorization': 'Basic Base64String==',
|
'Authorization': 'Basic Base64String==',
|
||||||
'Cookie': 'foo=bar; user=romeo',
|
'Cookie': 'foo=bar; user=romeo',
|
||||||
'X-Tracking': 'Base64String=='
|
'X-Tracking': 'Base64String==',
|
||||||
};
|
};
|
||||||
expect(prepareHeaders(headers), {
|
expect(prepareHeaders(headers), {
|
||||||
'Authorization': 'Basic Base64String==',
|
'Authorization': 'Basic Base64String==',
|
||||||
|
Loading…
Reference in New Issue
Block a user