Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
Greg Holmes 21cbd44046
Publish to github packages (#815)
4 gadus atpakaļ
.github/workflows Publish to github packages (#815) 4 gadus atpakaļ
api Update autovalue to 1.6. 6 gadus atpakaļ
bundles Remove unnecessary asserts. 7 gadus atpakaļ
docs First pass at a style guide. 7 gadus atpakaļ
etc Rename PMD ruleset, update PMD. 7 gadus atpakaļ
gradle Publish to github packages (#815) 4 gadus atpakaļ
src Fix imports 6 gadus atpakaļ
.gitignore Ignore .nb-gradle folder 7 gadus atpakaļ
AUTHORS McCormack => Mc Cormack 5 gadus atpakaļ
LICENCE Update copyright for 2017 7 gadus atpakaļ
README.md Add info about how to display text... 8 gadus atpakaļ
UpdateCopyright.sh We're missing a file! 10 gadus atpakaļ
build-installer.xml Build process improvements. 10 gadus atpakaļ
build.gradle Throttle unread status changes. 6 gadus atpakaļ
circle.yml Add support for sending coverage to codacy. 7 gadus atpakaļ
gradle.properties Add a bit more info to version.config. 9 gadus atpakaļ
gradlew Update gradle to 3.1. 7 gadus atpakaļ
gradlew.bat Update gradle to 3.1. 7 gadus atpakaļ
settings.gradle Move Yaml utils to com.dmdirc.util.io.yaml bundle. 7 gadus atpakaļ

README.md

DMDirc

DMDirc is an IRC client written in Java. It’s cross-platform, hugely configurable, and is easily extensible with a robust plugins system.

This repository contains the ‘core’ of the client. If you’re interested in developing DMDirc or building it from scratch, you’d be much better off cloning the meta repository, which contains the core, plugins, IRC library, etc. Detailed setup instructions are available there as well.

Development information

Displaying text

Text shown in windows (channels, servers, etc) is generated automatically from certain types of events passed on the DMDirc event bus. Any event that subclasses DisplayableEvent can potentially be formatted.

DisplayableEvents are listened for by each window’s BackBuffer instance. A format is then applied to the event to transform it into one or more strings. Formats are specified in a YAML file included in the DMDirc jar, and can be overridden by the user by putting a format.yml file in their DMDirc config directory.

A couple of typical formatting entries looks like this:

ChannelMessageEvent:
  format: "<{{client.modePrefixedNickname}}> {{message}}"
ChannelModeNoticeEvent:
  format: "-{{client.modePrefixedNickname}}:{{prefix}}{{channel.name}}- {{message}}"
  colour: 5

The {{..}} templates retrieve properties from the event itself. {{client.modePrefixedNickname}} is the equivalent of calling getClient().getModePrefixedNickname().toString() on the event object.

Error handling

DMDirc has a user interface for displaying details of errors to users. It also supports uploading of errors to the DMDirc sentry instance if the user allows it (or manually clicks on send).

Errors should be logged using a Slf4j logger, and marked with one markers defined in LogUtils. These markers allow developers to specify whether an error is an “Application” error (which will get reported and should ultimately be fixed), or a “User” error (which is due to a problem with the user’s config, environment, etc), and also whether the error is fatal or not.

A typical class that reports errors will look something like the following:

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static com.dmdirc.util.LogUtils.APP_ERROR;

public class MyClass {

    private static final Logger LOG = LoggerFactory.getLogger(MyClass.class);

    public void doSomething() {
        try {
            // Do something
        } catch (SomeException ex) {
            LOG.error(APP_ERROR, "Couldn't do something!", ex);
        }
    }

}