… | |
… | |
10 | use CFPlus::UI; |
10 | use CFPlus::UI; |
11 | use CFPlus::Pod; |
11 | use CFPlus::Pod; |
12 | use CFPlus::Macro; |
12 | use CFPlus::Macro; |
13 | use CFPlus::Item; |
13 | use CFPlus::Item; |
14 | |
14 | |
15 | use Crossfire::Protocol::Base 0.95; |
|
|
16 | |
|
|
17 | use base 'Crossfire::Protocol::Base'; |
15 | use base 'Crossfire::Protocol::Base'; |
18 | |
16 | |
19 | sub new { |
17 | sub new { |
20 | my ($class, %arg) = @_; |
18 | my ($class, %arg) = @_; |
21 | |
19 | |
22 | my $self = $class->SUPER::new (%arg, |
20 | my $self = $class->SUPER::new (%arg, |
23 | setup_req => { |
21 | setup_req => { |
24 | extmap => 1, |
22 | extmap => 1, |
25 | excmd => 1, |
23 | excmd => 1, |
26 | xwidget2 => 1,#d# |
24 | #xwidget2 => 1,#d# |
27 | %{$arg{setup_req} || {}}, |
25 | %{$arg{setup_req} || {}}, |
|
|
26 | msg => 0, |
28 | }, |
27 | }, |
29 | ); |
28 | ); |
30 | |
29 | |
31 | $self->{map_widget}->clr_commands; |
30 | $self->{map_widget}->clr_commands; |
32 | |
31 | |
… | |
… | |
969 | |
968 | |
970 | sub sanitise_xml($) { |
969 | sub sanitise_xml($) { |
971 | local $_ = shift; |
970 | local $_ = shift; |
972 | |
971 | |
973 | # we now weed out all tags we do not support |
972 | # we now weed out all tags we do not support |
974 | s%<(?!/?i>|/?u>|/?b>|fg |/fg>)%<%g; |
973 | s{ <(?! /?i> | /?u> | /?b> | /?big | /?small | /?s | /?tt | fg\ | /fg>) |
|
|
974 | }{ |
|
|
975 | "<" |
|
|
976 | }gex; |
|
|
977 | |
975 | # now all entities |
978 | # now all entities |
976 | s/&(?!amp;|lt;|gt;|apos;|quot;|#[0-9]+;|#x[0-9a-fA-F]+;)/&/g; |
979 | s/&(?!amp;|lt;|gt;|apos;|quot;|#[0-9]+;|#x[0-9a-fA-F]+;)/&/g; |
977 | |
980 | |
978 | # handle some elements |
981 | # handle some elements |
979 | s/<fg name='([^']*)'>(.*?)<\/fg>/<span foreground='$1'>$2<\/span>/gs; |
982 | s/<fg name='([^']*)'>(.*?)<\/fg>/<span foreground='$1'>$2<\/span>/gs; |
… | |
… | |
1038 | ::message ({ |
1041 | ::message ({ |
1039 | fg => $fg, |
1042 | fg => $fg, |
1040 | markup => $_, |
1043 | markup => $_, |
1041 | type => $type, |
1044 | type => $type, |
1042 | extra => [@extra], |
1045 | extra => [@extra], |
1043 | color_flags => $color, #d# ugly, kill |
1046 | color_flags => $color, #d# ugly, kill |
1044 | }); |
1047 | }); |
1045 | |
1048 | |
1046 | $color &= ~NDI_CLEAR; # only clear once for multiline messages |
1049 | $color &= ~NDI_CLEAR; # only clear once for multiline messages |
1047 | # actually, this is an ugly design. _we_ should control the channels, |
1050 | # actually, this is an ugly design. _we_ should control the channels, |
1048 | # not some random other widget, as the channels are clearly protocol-specific. |
1051 | # not some random other widget, as the channels are clearly protocol-specific. |
… | |
… | |
1053 | $self->{statusbox}->add ($text, |
1056 | $self->{statusbox}->add ($text, |
1054 | group => $text, |
1057 | group => $text, |
1055 | fg => $fg, |
1058 | fg => $fg, |
1056 | timeout => $color >= 2 ? 180 : 10, |
1059 | timeout => $color >= 2 ? 180 : 10, |
1057 | tooltip_font => $::FONT_FIXED, |
1060 | tooltip_font => $::FONT_FIXED, |
1058 | ); |
1061 | ) if $type eq "info"; |
1059 | } |
1062 | } |
1060 | } |
1063 | } |
1061 | |
1064 | |
1062 | sub spell_add { |
1065 | sub spell_add { |
1063 | my ($self, $spell) = @_; |
1066 | my ($self, $spell) = @_; |