Skip to content

Commit

Permalink
Fixed all warnings prohibiting publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
Perondas authored and Perondas committed Feb 20, 2023
1 parent 3f5de67 commit 88b8317
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion lib/src/logger.dart
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class AnsiColor {

String call(String msg) {
if (color) {
return '${this}$msg$ansiDefault';
return '$this$msg$ansiDefault';
} else {
return msg;
}
Expand Down
14 changes: 7 additions & 7 deletions lib/src/rtc_session.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2701,14 +2701,14 @@ class RTCSession extends EventManager implements Owner {
* Correctly set the SDP direction attributes if the call is on local hold
*/
String? _mangleOffer(String? sdpInput) {
if (!_localHold! && !_remoteHold!) {
if (!_localHold && !_remoteHold) {
return sdpInput;
}

Map<String, dynamic> sdp = sdp_transform.parse(sdpInput!);

// Local hold.
if (_localHold! && !_remoteHold!) {
if (_localHold && !_remoteHold) {
logger.d('mangleOffer() | me on hold, mangling offer');
for (Map<String, dynamic> m in sdp['media']) {
if (holdMediaTypes.indexOf(m['type']) == -1) {
Expand All @@ -2724,7 +2724,7 @@ class RTCSession extends EventManager implements Owner {
}
}
// Local and remote hold.
else if (_localHold! && _remoteHold!) {
else if (_localHold && _remoteHold) {
logger.d('mangleOffer() | both on hold, mangling offer');
for (Map<String, dynamic> m in sdp['media']) {
if (holdMediaTypes.indexOf(m['type']) == -1) {
Expand All @@ -2734,7 +2734,7 @@ class RTCSession extends EventManager implements Owner {
}
}
// Remote hold.
else if (_remoteHold!) {
else if (_remoteHold) {
logger.d('mangleOffer() | remote on hold, mangling offer');
for (Map<String, dynamic> m in sdp['media']) {
if (holdMediaTypes.indexOf(m['type']) == -1) {
Expand All @@ -2756,16 +2756,16 @@ class RTCSession extends EventManager implements Owner {
void _setLocalMediaStatus() {
bool enableAudio = true, enableVideo = true;

if (_localHold! || _remoteHold!) {
if (_localHold || _remoteHold) {
enableAudio = false;
enableVideo = false;
}

if (_audioMuted!) {
if (_audioMuted) {
enableAudio = false;
}

if (_videoMuted!) {
if (_videoMuted) {
enableVideo = false;
}

Expand Down
10 changes: 5 additions & 5 deletions lib/src/sip_ua_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -371,15 +371,15 @@ class SIPUAHelper extends EventManager {

void _notifyTransportStateListeners(TransportState state) {
// Copy to prevent concurrent modification exception
var _listeners = _sipUaHelperListeners.toList();
List<SipUaHelperListener> _listeners = _sipUaHelperListeners.toList();
for (SipUaHelperListener listener in _listeners) {
listener.transportStateChanged(state);
}
}

void _notifyRegistrationStateListeners(RegistrationState state) {
// Copy to prevent concurrent modification exception
var _listeners = _sipUaHelperListeners.toList();
List<SipUaHelperListener> _listeners = _sipUaHelperListeners.toList();
for (SipUaHelperListener listener in _listeners) {
listener.registrationStateChanged(state);
}
Expand All @@ -393,23 +393,23 @@ class SIPUAHelper extends EventManager {
}
call.state = state.state;
// Copy to prevent concurrent modification exception
var _listeners = _sipUaHelperListeners.toList();
List<SipUaHelperListener> _listeners = _sipUaHelperListeners.toList();
for (SipUaHelperListener listener in _listeners) {
listener.callStateChanged(call, state);
}
}

void _notifyNewMessageListeners(SIPMessageRequest msg) {
// Copy to prevent concurrent modification exception
var _listeners = _sipUaHelperListeners.toList();
List<SipUaHelperListener> _listeners = _sipUaHelperListeners.toList();
for (SipUaHelperListener listener in _listeners) {
listener.onNewMessage(msg);
}
}

void _notifyNotifyListeners(EventNotify event) {
// Copy to prevent concurrent modification exception
var _listeners = _sipUaHelperListeners.toList();
List<SipUaHelperListener> _listeners = _sipUaHelperListeners.toList();
for (SipUaHelperListener listener in _listeners) {
listener.onNewNotify(Notify(request: event.request));
}
Expand Down
3 changes: 1 addition & 2 deletions lib/src/transports/websocket_interface.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import 'websocket_dart_impl.dart'
if (dart.library.js) 'websocket_web_impl.dart';

class WebSocketInterface implements Socket {
final int _messageDelay;

WebSocketInterface(String url,
{required int messageDelay, WebSocketSettings? webSocketSettings})
: _messageDelay = messageDelay {
Expand All @@ -34,6 +32,7 @@ class WebSocketInterface implements Socket {
}
_webSocketSettings = webSocketSettings ?? WebSocketSettings();
}
final int _messageDelay;

String? _url;
String? _sip_uri;
Expand Down
6 changes: 3 additions & 3 deletions test/all_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void main() {
for (Function func in DigestAuthentication.testFunctions) {
func();
}
for (Function func in Websocket.testFunctions) {
//func();
}
//for (Function _func in Websocket.testFunctions) {
//func();
//}
}

0 comments on commit 88b8317

Please sign in to comment.