Search in sources :

Example 1 with Donor

use of irc.Donor in project Botnak by Gocnak.

the class DonationManager method addDonation.

public void addDonation(Donation d, boolean isLocal) {
    if (!donationsContains(d.getDonationID()) || isLocal) {
        if (donations.add(d)) {
            Donor don = getDonor(d.getFromWho());
            if (don == null) {
                don = new Donor(d.getFromWho(), d.getAmount());
                addDonor(don);
            } else {
                don.addDonated(d.getAmount());
            }
            if (!isLocal) {
                Settings.DONATIONS.save();
                Settings.DONORS.save();
                setLastDonation(d);
                if (BotnakTrayIcon.shouldDisplayDonations()) {
                    GUIMain.getSystemTrayIcon().displayDonation(d);
                }
                MessageQueue.addMessage(new Message().setChannel(Settings.accountManager.getUserAccount().getName()).setType(Message.MessageType.DONATION_NOTIFY).setContent(String.format("%s has just donated %s! Lifetime total: %s ", d.getFromWho(), getCurrencyFormat().format(d.getAmount()), getCurrencyFormat().format(don.getDonated()))).setExtra(d));
            }
        }
    }
}
Also used : Donor(irc.Donor) Message(irc.message.Message)

Aggregations

Donor (irc.Donor)1 Message (irc.message.Message)1