Coder Social home page Coder Social logo

pm-cb's Introduction

pm-cb is Copyright (C) 2017-2020, E. Choroba

PerlMonks ChatterBox Client

DESCRIPTION

There are two executable programs, pm-cb and pm-cb-g. The former doesn't implement a full chat client (you can't use it to post to the ChatterBox) and is no longer supported. The latter is a graphical client to PerlMonks' ChatterBox written in Perl and Tk.

Pull requests welcome!

PREQUISITES

Install required modules using

cpanm --installdeps .

If your perl has been compiled with thread support:

perl -MConfig -E 'say "Threads supported" if $Config{useithreads}'

you can simply start the program with

perl pm-cb-g

If threads are not supported, either compile a new perl with threads enabled, e.g.

perlbrew install perl-5.30.0 --as=5.30.0-threads -Dusethreads
perlbrew use 5.30.0-threads

or run the program using MCE::Hobo with

perl pm-cb-g --mce_hobo

or with MCE::Child

perl pm-cb-g --mce_child

LICENSE INFORMATION

This code is free software; you can redistribute it and/or modify it under the same terms as Perl 5.30 (see the Perl Artistic License and the GNU General Public License, version 1).

pm-cb's People

Contributors

choroba avatar hakonhagland avatar lorenzota avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pm-cb's Issues

problem of login dialog box on windows

hello,
when login dialog box spawns it seems not selectable on Windows: it onyl appears if I hover the mouse on the chat on the toolbar, but is not selectable
I'll investigate further as I have time

Fix UTF-8

Currently, characters are mangled badly (encode/decode should help)

Indicate activity

Change/blink the icon on activity, maybe even more on a personal msg

Crash on high unicode characters

Trying to post this character: ๐Ÿ––

Program crashed with the following in the terminal:

UCS-2BE:code point "\x{1f596}" too high at /home/nick/perl5/perlbrew/perls/perl-5.26.1/lib/site_perl/5.26.1/x86_64-linux/Tk.pm line 251, <__ANONIO__> line 22.
UCS-2BE:code point "\x{1f596}" too high at /home/nick/perl5/perlbrew/perls/perl-5.26.1/lib/site_perl/5.26.1/x86_64-linux/Tk.pm line 424, <__ANONIO__> line 22.
Finished with active Hobos [4382.0.main] (1)

Have a configuration file

~/.pm-cb/config or ~/.config/pm-cb where I can set my preferences:

font-name:              DejaVu Sans Mono
font-size:              9
stack-size:             17
history-file:           ~/.pm-cb/logs/pm.log
history-size:           -1
show-timestamps:        yes
background-color:       white
foreground-color:       black
author-color:           darkgreen
private-color:          magenta
gesture-color:          darkblue
time-color:             gray40
seen-color:             darkgray
browser-url:            www.perlmonks.org
random-url:             no
use-mce:                yes
geometry:               1100x650+400+150
date-format:            %Y-%m-%d %H:%M:%S
time-format:            %m-%d %H:%M|
copy-url:               <Button-2>
xmodifiers:             no

Feature request: save history in file

Like hexchat: save the window history in a file (e.g. ~/.pm-cb/logs/pm.log = easy to grep) and reload last n lines (configurable in ~/.pm-cb/config, default 50, see #37) on restart.
Now that #cbstream is out of order, there is no log in my hexchat logs to grep or scrollback in. Having pm-cb-g always open would get me that back

bareword found at line 63 and full path needed for Proc::Background on win32

hello, with Latest commit e6900b6 I have errors:

1)with sub { $_[0]->list(threads::running)} I get:
Bareword "threads::running" not allowed while "strict subs" in use at pmchatTk10.pl line 48. BEGIN not safe after errors--compilation aborted at pmchatTk10.pl line 63.

No errors quoting it sub { $_[0]->list('threads::running')} so this seems easy

  1. Proc::Background alwys needs absolute path for executables on windows
    perl -MProc::Background -we "Proc::Background->new('start', 'www.perlmonks.org') or die qq($^E)" -e: cannot find absolute location of start

2a) unfortunately 'start' it's not even a command! it does not exists a start.exe in the filesystem.
It is a so called 'internal command' internal to cmd.exe See https://ss64.com/nt/syntax-internal.html

2b) playing with 'cmd.exe /k start ..' is a pain and probably adead path

2c) Assuming chrome as default browser, you need full path anyway:
perl -MProc::Background -we "Proc::Background->new('chrome', 'www.perlmonks.org') or die qq($^E)" -e: cannot find absolute location of chrome

with full path is ok, but you need to specify 'http:\www....' :

perl -MProc::Background -we "Proc::Background->new('C:\Program Files (x86)\Google\Chrome\Application\chrome', 'http:\\www.perlmonks.org') or die qq($^E)"

2d) So, if the 'start' trick is useful while in cmd.exe is not usable outside it: to get default browser on windows you must access the registry at HKEY_CURRENT_USER\Software\Clients\StartMenuInternet\(Default) is not difficult. if you want I can write a BEGIN block for win32 users or you can simply die "Win32 users MUST specify the browser used for link with full path"

PS perl pmchatTk10.pl -b blue -f gold -a red -mce -B "C:\Program Files (x86)\Google\Chrome\Application\chrome" runs fine

thanks
Discipulus

Font setting not working on Ubuntu

I changed the font to Arial which I have installed in my system, but the app still uses the default which is a serif font of some kind.

This is on Ubuntu Xenia.

output repetitions

hi,
yesterday i was running your client (probably 82298a6 ie your version without my --help modification) and
today I found many lines replicated in the RoText output.

Since i use --no_time I'm not able to tell you the exact moment the issue appeared, but the first doubled line contains

hey, .... la la laaa laa, la la la

After some times every line appearead 3 times, then 4 times and this moring each line appeared 5 times.

Probably when the issue appeared I was logged with the same client from another PC at home,but i'm not sure of the time coincidence.

relaunching the client with current dd36ae2 version works as expected

L*

Retry failed title requests

Sometimes, a title request gets lost, or the answer. Retry failed title requests, but not too often to flood the server.

untitled nodes shown as empty link

Hello choroba,

I linked in your client to [id://11146887] and it is shown as [] in your client while in the chatterbox is correctly shown as [untitled node, ID 11146887]. Both effectively links to the correct node.

This should be easy to fix :)

L* aka Discipulus

Right-click menu on links/URL's

Can I please have a right-click menu on links/URL's with at least the command "Copy URL" (or "Copy link address"), so I can open it in an application of choice.

Jump to search terms or rules

Using cbstream inside hexchat, what I miss is to be able to jump (in history) to the first message line where text appeared that I highlighted by rules (like on my alias or on several specific subjects, like CSV or HP-UX
When away from CB for longer (hours, days, weeks), it would be awesome to jump to those lines skipping the rest of the chatter

Shift-Insert does not paste on input window

Middle-button paste does work, but being a keyboard junk I want Shift-Insert to also work. I tried this:

diff --git a/lib/PM/CB/GUI.pm b/lib/PM/CB/GUI.pm
index bf2ff2c..3ae6340 100644
--- a/lib/PM/CB/GUI.pm
+++ b/lib/PM/CB/GUI.pm
@@ -3,6 +3,7 @@ package PM::CB::GUI;
 use 5.18.2;
 use warnings;

+use Clipboard;
 use constant {
     TITLE        => 'PM::CB::G',
     PUBLIC       => 0,
@@ -70,6 +71,11 @@ sub gui {
         -foreground => $self->{fg_color},
         -wrap       => 'word',
     )->pack(-fill => 'x');
+    $write->bind("<Shift-Insert>", sub {
+        say "FOOO!";
+        my $txt = Clipboard->paste;
+       say $txt;
+       $txt and $write->insert('end', $txt) });

     my $button_f = $mw->Frame->pack;
     my $send_b = $button_f->Button(-text => 'Send',

but it prints FOOO! and than hangs, so maybe the is some conflict deep down somewhere. (I also used 'insert' instead of 'end', but it proves to hang before the say $txt;

Include /msg

Also, clicking on a name could insert /msg name into the write area.

bad event type or keysym "Page_Up"

hello, tryng the latest version 52d2105 I got:
bad event type or keysym "Page_Up" at D:/ulisse/perl5.26.64bit/perl/site/lib/Tk/Derived.pm line 469. Perl exited with active threads: 2 running and unjoined 0 finished and unjoined 0 running and detached

modulirezed new cause of restarting worker

hello, new modulirezed version restart worker (run with -mce):
Use of uninitialized value $ok in numeric eq (==) at path/pm-cb-modulirize/lib/PM/CB/Control.pm line 41, <__ANONIO__> line 1. Restarting worker...

As side note, no more duplicated messages are printed, but 'some' message is lost.

`[onefloid]: Oh, seems like LanX' team has won the fourth World Cup ... awesome!
[root]: You've got a reply to [Re: Some Help for a Report About Perl] from [TDL4] at [Re^2: Some Help for a Report About Perl]

here i said:
[Discipulus]: /me is ruling Weekly Best.. what decayng world
and this is not in cb::g rotext

[LanX]: scandalous! ;)
[Happy-the-monk]: hear, hear!
[Discipulus]: bear bear`

decode problem on strawberry 5.26

hello,

In my new machine with win10 I freshly installed Strawberry Perl (64-bit) Portable 5.26.0.2-64bit
plus a bounch of modules needed by your program:
Perl 5.026000 MCE::Hobo 1.831 Parallel::ForkManager 1.19 Encode 2.92

then I got no messages displayed in the chatbox but inly timestamps of private messages and the following error:

`
d:\SCRIPTS>perl pmchatTk09.pl -b blue -f gold -a red -mce
Prototype mismatch: sub main::decode: none vs ($$;$) at D:/ulisse/perl5.26.64bit/perl/lib/Exporter.pm line 66, <ANONIO> line 16.
at D:/ulisse/perl5.26.64bit/perl/site/lib/Tk.pm line 22.
Use of uninitialized value $message in concatenation (.) or string at pmchatTk09.pl line 298, <ANONIO> line 2.
Use of uninitialized value $message in concatenation (.) or string at pmchatTk09.pl line 298, <ANONIO> line 19.
Use of uninitialized value $msg in substitution (s///) at pmchatTk09.pl line 306, <ANONIO> line 29.
Use of uninitialized value $msg in concatenation (.) or string at pmchatTk09.pl line 320, <ANONIO> line 29.
Use of uninitialized value $msg in substitution (s///) at pmchatTk09.pl line 306, <ANONIO> line 30.
Use of uninitialized value $msg in concatenation (.) or string at pmchatTk09.pl line 320, <ANONIO> line 30.
Use of uninitialized value $msg in substitution (s///) at pmchatTk09.pl line 306, <ANONIO> line 31.
Use of uninitialized value $msg in concatenation (.) or string at pmchatTk09.pl line 320, <ANONIO> line 31.
Use of uninitialized value $msg in substitution (s///) at pmchatTk09.pl line 306, <ANONIO> line 32.

..etc etc
`

Renaming your sub decode in _decode the problem disappeared

thanks
Discipulus

Links containing & don't work

Because they're prefixed with perlmonks address, so the & is interpreted as the separator for perlmonks, not the target site.

Some messages sent from pm-cb-g not displayed in the CB

When resending the same message, PM returns the "Whoa cowboy" repost warning. According to Tanctalus, the user's last message is cached somewhere, and only after that it gets saved to the database. The caching happens in the described case, but saving to the database does not.

Handle /me

Replace /me by the user's name, maybe use italics.

Reconnect after forced logout

Suddenly, I was unable to post, and PM returned "You can't post when not logged in" (exact quotation needed).

If such a response comes back, try to re-log in.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.