GithubHelp home page GithubHelp logo

zarino / backchat Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 536 KB

A hackable IRC client for Mac OS X, built with Electron (atom-shell), HTML and JavaScript

HTML 1.72% JavaScript 77.88% CSS 19.78% Shell 0.62%

backchat's People

Contributors

zarino avatar

Stargazers

 avatar

Watchers

 avatar  avatar

backchat's Issues

Do not notify me about stage directions

Channel topics, people joining and people leaving should not cause a notification to be added to the channelButtonView in the sidebar, or to the dock icon.

Only messages and actions should trigger notifications.

Show historic scrollback content on startup

If we join a channel that has logs from the past 24 hours, show that day's logs at the top of the scrollback, greyed out.

This is particularly handy when quitting IRC at lunchtime, and wanting to easily scroll back up to see what was discussed in the morning. Or when joining first thing in the morning and wanting to see what was discussed last thing the previous night.

New items in direct message channels should ping if app is in background

If someone sends me a private message, and the app is in the background, I should be notified just as if they'd mentioned my name in a public channel.

That means an audible ping, and a red number on the dock icon.

Not sure whether there should also be a red number in the channelButton, or whether we should keep that for mentions of keywords only. I have a feeling, for consistency, there should be a red number in the channelButton, since otherwise, how am I meant to find out what triggered the beep that made me return to the app?

Special notification badge in sidebar for keyword mentions

Building on top of #4 – if a keyword (eg: for now, the user's nick) is mentioned in a background channel, then a second badge should show in the sidebar for that channel, with the total number of missed mentions in that channel.

Focussing the channel should clear the badge, as normal.

The styling for this is already here:

&.important {
background-color: $color-mac-red;
color: #fff;

Save state on quit

Things I would expect to be saved:

  • Which servers I'm connected to.
  • Which channels I'm connected to.
  • Which private messages are currently open.
  • What order the channels / private messages are in my sidebar.

Perfectly happy for these to be saved to settings.json, so they're all slurped in automatically next time I start up.

Show spellcheck correction suggestions in right-click

75df6f7 added native spellchecking for the message composition box. However, when you right-click underlined words, nothing happens.

Here's the menu I get when I right-click a misspelt word in a standard Chrome textarea:

screen shot 2015-08-04 at 07 38 01

The absolute minimum to satisfy this ticket would just have a right-click menu containing the spelling suggestions.

But to make it feel like a real Mac app (see #47), I'd also expect Cut/Copy/Paste/Delete, Select All, maybe even Look Up in Dictionary.

XSS vulnerability via messages

Messages are simply inserted into the DOM, without any HTML escaping. So structural and formatting tags are included, and script tags are evaluated.

We need to sanitize HTML tags (turn < into &lt; etc) at some point before we add our own formatting (eg: the <strong> tags around keyword mentions).

Tab-complete for nicks in current channel

On tab press, match the current (partial) word against all the nicks in the channel, case-insensitively. If there's a match, replace the current (partial) word with the full nick.

Show unread counts in sidebar when background channels receive messages

There are two cases when a message should be classed as "unread" and therefore added to an "unread count" next to the channel name in the sidebar:

  1. When the target channel is hidden (ie: not the currently focussed channel)
  2. Or when the window is blurred (ie: not the foremost window)

Focussing a channel with missed messages (ie: by switching to it in the sidebar or, if the channel is current visible but the window is blurred, just switching to the window) should remove the unread count.

Dramatic difference in UI appearance when user is set as “away”

It should be obvious when I’m set as away on the current server.

The change in appearance (and its reversion back to normal) should happen as soon as my /away command has been accepted by the server.

(Note: this is a per-server setting. I could be away on one server, and active on another.)

Start a new private message thread by double-clicking a name in the user list

Double-clicking a person's name in a channel's user list, should create and focus a new (blank) channelView, with a sidebar channelViewButton named after the target user, and should focus the text input.

If a private message channel with the target user already exists, it should just be focussed instead (rather than creating a new one)

Join password-protected channels

Normally you'd run:

/join some-channel some-password

Make sure this works when run from the text input in the UI.

But more importantly, make sure it works in the settings.json file.

Move logic out of client.js and into main.js

Right now lots of logic is split between main.js and client.js, meaning a confusing mix of events flying everywhere, and duplication of functions (like tracking which channel is currently active).

Really, anything on the raw IRC level should be handled by connection-pool.js (as it is currently), then everything else, including state storage like which users are connected to which channels, with which away messages, and which channel is currently active etc, should all be handled by main.js, with main.js sending events to client.js when something in the UI needs to change (ie: sending events like client:addUserToChannel rather than generic events like channel:joined).

Menu item to reveal current log file in Finder

Once #6 has been done, having a menu item that opens the current channel's log file in the Finder would be handy!

var path = app.getPath('userData') + '/' + serverName + '/' + channelName + '/' + isoDate + '.txt';
shell.showItemInFolder(path);

Notifications in scrollback when a user activates or deactivates “away”

We'll need to poll the server for user status. Probably more efficient to do this using client.send('WHO', '#channelName') than to maintain a list of users we've seen in all the channels on the server and query each one with client.whois() individually.

The response to a raw WHO command will be sent in a raw event, with one event per user. The events all have a command attribute of 'rpl_whoreply'.

Looks like the interesting bits of the response to a raw WHO command are:

[raw] {
  server: 'irc.server.org',
  command: 'rpl_whoreply',
  …
  args: [ 
    'MyNick',
    '#channelName',
    'TheirUsername',
    'TheirHost',
    'irc.server.org',
    'TheirNick',
    'H',
    '0 TheirFullName'
  ]
}

This is repeated for each user in the channel. the 7th item in the args array is the status, H for “Here” and G for “Gone”. Looks like it can be followed by characters like * or @ if the user is an admin too.

App menu shows "Leave channel" even when channel is already parted, or is a private chat

The right-click menu shows the right options, which are some combination of "Remove from sidebar", "Close channel", and "Join channel", depending on the state and type of channel.

The main menu, however, always shows "Leave channel".

To fix this, the client will have to notify the server whenever the activeChannel is changed, and send it information about the new active channel, so it can update the menu to say the right things.

Name private message "channels" after the person who started them

Currently, if the third-party user "zarino" sends a private message to "nodebot122" who’s running backchat, the following happens:

screen shot 2015-05-10 at 20 26 56

A new channel appears in nodebot122's window, but rather than being named after the person who started the conversation (zarino), it's named after nodebot122.

This is because the original message:sent event looked like:

message:sent {
  "server": "irc.freenode.net",
  "fromUser": "zarino",
  "toUserOrChannel": "nodebot122",
  "messageText": "hello",
  "myNick": "nodebot122"
}

Which is right, from zarino's perspective. But when the message reaches nodebot122, the name should really be switched around. Because if it's not, sending messages to this new channel actually means sending messages to yourself (hence the double reply in the screenshot: two message:sent events are fired, one for the user, and one for the channel) – if the channel were named after the third-party user (zarino) then none of this would happen.

Users who join after me are incorrectly added to notification keywords

The channel:joined event handler incorrectly adds each new user’s nick to the keywords array. This means each user who joins after me is added to the array.

this.keywords.push(e.user);

I think the original intent of this line was to add my nick to the keywords array. Surely there must be a better way for the client to figure out what the current nick is and add it? Maybe the server could just add it to serverSettings.keywords before it's passed to the client?

Separately set which channels should be autojoined at startup

Right now, channels listed in the settings.json are all joined at startup.

For channels I don't regularly access, I prefer having them listed in the sidebar but not joined automatically.

It's most future-proof to change the channels property of the settings file, from a list of strings (channel names) to a list of objects, which contains the channel's settings, like:

{
  "servers": [
    {
      "name": "Freenode",
      "url": "irc.freenode.net",
      …
      "channels": [ 
        {
          name: "#bots", 
          autoJoin: false
        },
        {
          name: "#poplus",
          autoJoin: true
        }
      ]
    },
  "keywords": [ "tannoy" ]
}

Previous channel / next channel navigation with ⌘-[ and ⌘-] keyboard shortcuts

Given a the user is connected to more than one channel, ⌘-[ should switch to the channel above the current one in the sidebar, and ⌘-] should switch to the one below. The movement should wrap around the edges of the list, so ⌘-] at the end of the list will wrap back to the channel right at the top.

There are already hooks for this in the mac-menu.json template:

{ "label": "Next channel", "command": "application:nextChannel", "accelerator": "Command+]" },
{ "label": "Previous channel", "command": "application:previousChannel", "accelerator": "Command+[" },

We just need to add listeners for application:nextChannel and application:previousChannel in main.js. And then pass the message on to the client, and write the looping code in client.js.

Auto-detect image previews in links

If an incoming message includes a URL, scrape it and look for image meta tags that might be useful, eg:

<meta property="og:image" content="http://somedomain.com/image.png">
<meta name="twitter:image" value="http://somedomain.com/image.png">

If I message an “away” user in a private chat, show me their away message

This would probably be best done with an always-visible banner at the top of the chat window, rather than a repeated "response" to each message I send them.

When a user activates away, the banner appears, and when they deactivate away, it disappears. And if you start a private chat with a user who's away, the banner is there from the start.

Show who set the channel topic, and when

The information's sent as part of a rpl_topicwhotime message from the IRC server:

[irc event] [raw] { prefix: 'wolfe.freenode.net',
  server: 'wolfe.freenode.net',
  command: 'rpl_topicwhotime',
  rawCommand: '333',
  commandType: 'reply',
  args: 
   [ 'nodebot122',
     '#bots',
     'RonG!~RonG@unaffiliated/rong',
     '1409104006' ] }

The bit before the ! is the nickname.

Log server messages to a sort of channelView in the UI

It's handy being able to see what the server is saying, especially for things like server notices during the connection process.

Right now, that stuff is output to the developer console. But when the app runs as a proper binary, there is no console. So a serverView, just like the existing channelViews, with a serverButtonView that toggles its visibility, would be handy.

Active state and "focus" state for channel list buttons should be the same

When clicking on a channel means that the text input is immediately focussed, it doesn't make any sense to have a blue "focus" state for the channel buttons alongside the normal grey "active" state.

Textual IRC client gets round this by only having a single state, which is a strong blue, no matter whether the button is really focussed or just active.

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.