Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.app.NotificationManager
import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import android.graphics.BitmapFactory
import android.os.Build
import android.provider.Settings
import io.flutter.embedding.engine.FlutterEngine
Expand Down Expand Up @@ -195,6 +196,9 @@ object AndroidIrcxEngineManager {
}
builder
.setSmallIcon(R.drawable.ic_stat_androidircx)
.setLargeIcon(
BitmapFactory.decodeResource(context.resources, R.mipmap.ic_launcher),
)
.setContentTitle(title)
.setContentText(body)
.setStyle(Notification.BigTextStyle().bigText(body))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import android.app.Service
import android.content.Context
import android.content.Intent
import android.content.pm.ServiceInfo
import android.graphics.BitmapFactory
import android.os.Build
import android.os.IBinder

Expand Down Expand Up @@ -119,6 +120,9 @@ class AndroidIrcxForegroundService : Service() {

builder
.setSmallIcon(R.drawable.ic_stat_androidircx)
.setLargeIcon(
BitmapFactory.decodeResource(resources, R.mipmap.ic_launcher),
)
.setContentTitle(getString(R.string.notification_connection_title))
.setContentText(compactText)
.setStyle(Notification.BigTextStyle().bigText(bigText))
Expand Down
Binary file modified android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions lib/core/app/app_version.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const appVersionName = '1.0.6';
const appVersionCode = 9;
const appVersion = '$appVersionName+$appVersionCode';

const ctcpVersionReply = 'AndroidIRCX Flutter v$appVersion';
145 changes: 145 additions & 0 deletions lib/features/chat/application/ban_mask_service.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
class BanMaskType {
const BanMaskType({
required this.id,
required this.pattern,
required this.description,
required this.example,
});

final int id;
final String pattern;
final String description;
final String example;
}

const List<BanMaskType> banMaskTypes = <BanMaskType>[
BanMaskType(
id: 0,
pattern: '*!user@host',
description: 'Ban by user@host',
example: '*!john@192.168.1.1',
),
BanMaskType(
id: 1,
pattern: '*!*user@host',
description: 'Ban by *user@host',
example: '*!*john@192.168.1.1',
),
BanMaskType(
id: 2,
pattern: '*!*@host',
description: 'Ban by host only',
example: '*!*@192.168.1.1',
),
BanMaskType(
id: 3,
pattern: '*!*user@*.host',
description: 'Ban by *user@*.domain',
example: '*!*john@*.example.com',
),
BanMaskType(
id: 4,
pattern: '*!*@*.host',
description: 'Ban by *.domain only',
example: '*!*@*.example.com',
),
BanMaskType(
id: 5,
pattern: 'nick!user@host',
description: 'Ban exact nick!user@host',
example: 'John!john@192.168.1.1',
),
BanMaskType(
id: 6,
pattern: 'nick!*user@host',
description: 'Ban nick with *user@host',
example: 'John!*john@192.168.1.1',
),
BanMaskType(
id: 7,
pattern: 'nick!*@host',
description: 'Ban nick with any user@host',
example: 'John!*@192.168.1.1',
),
BanMaskType(
id: 8,
pattern: 'nick!*user@*.host',
description: 'Ban nick with *user@*.domain',
example: 'John!*john@*.example.com',
),
BanMaskType(
id: 9,
pattern: 'nick!*@*.host',
description: 'Ban nick with *.domain',
example: 'John!*@*.example.com',
),
BanMaskType(
id: 10,
pattern: 'nick!*@*',
description: 'Ban by nick only',
example: 'John!*@*',
),
BanMaskType(
id: 11,
pattern: '*!ident@*',
description: 'Ban by ident only',
example: '*!john@*',
),
];

class BanMaskService {
const BanMaskService();

String generateBanMask({
required String nick,
required String ident,
required String host,
required int type,
}) {
final processedIdent = ident.startsWith('~') ? ident.substring(1) : ident;
final processedHost = _processHost(host, type);

switch (type) {
case 0:
return '*!$processedIdent@$host';
case 1:
return '*!*$processedIdent@$host';
case 2:
return '*!*@$host';
case 3:
return '*!*$processedIdent@$processedHost';
case 4:
return '*!*@$processedHost';
case 5:
return '$nick!$processedIdent@$host';
case 6:
return '$nick!*$processedIdent@$host';
case 7:
return '$nick!*@$host';
case 8:
return '$nick!*$processedIdent@$processedHost';
case 9:
return '$nick!*@$processedHost';
case 10:
return '$nick!*@*';
case 11:
return '*!$processedIdent@*';
default:
return '*!*@$host';
}
}

String _processHost(String host, int type) {
if (!const <int>[3, 4, 8, 9].contains(type)) {
return host;
}
if (RegExp(r'^\d+\.\d+\.\d+\.\d+$').hasMatch(host)) {
return host.replaceFirst(RegExp(r'\.\d+$'), '.*');
}
final parts = host.split('.');
if (parts.length >= 2) {
return '*.${parts.skip(parts.length - 2).join('.')}';
}
return '*.$host';
}
}
Loading
Loading