Package ecks.services

Examples of ecks.services.SrvChannel_channel


    }

    public void handle_command(Service who, String user, String replyto, String arguments) {
        if (((SrvChannel) who).getChannels().containsKey(arguments.toLowerCase())) {

            SrvChannel_channel t = ((SrvChannel) who).getChannels().get(arguments.toLowerCase());
            Generic.curProtocol.outNOTICE(who, user, "\u0002Channel:\u0002 " + arguments);
            Generic.curProtocol.outNOTICE(who, user, "\u0002---------\u0002 ");

            if (t.getAllMeta().containsKey("_ts_registered"))
                Generic.curProtocol.outNOTICE(who, user, "Registered On: " + DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG).format(new Date(Integer.parseInt(t.getMeta("_ts_registered")) * 1000L)));
            else
                Generic.curProtocol.outNOTICE(who, user, "Unknown Registration Date.");

            if (t.getAllMeta().containsKey("_ts_last"))
                Generic.curProtocol.outNOTICE(who, user, "Last had a user: " + DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG).format(new Date(Integer.parseInt(t.getMeta("_ts_last")) * 1000L)));
            else
                Generic.curProtocol.outNOTICE(who, user, "Has never had a user.");

            if (t.getAllMeta().containsKey("staffnote"))
                Generic.curProtocol.outNOTICE(who, user, "Staff Note: " + t.getMeta("staffnote"));
            else
                Generic.curProtocol.outNOTICE(who, user, "Has no staff note.");

            if (t.getAllMeta().containsKey("_isbad"))
                Generic.curProtocol.outNOTICE(who, user, "Is a naughty, naughty channel!");

            if (t.getAllMeta().size() == 0)
                Generic.curProtocol.outNOTICE(who, user, "Has no Metadata.");
            else
                Generic.curProtocol.outNOTICE(who, user, "Channel Metadata:");
            for (Map.Entry<String, String> e : t.getAllMeta().entrySet())
                Generic.curProtocol.outNOTICE(who, user, "    " + util.pad(e.getKey(), 14) + ": " + e.getValue());


            if (t.getUsers().size() == 0)
                Generic.curProtocol.outNOTICE(who, user, "Has no users.");
            else
                Generic.curProtocol.outNOTICE(who, user, "Channel Users:");
            for (Map.Entry<String, SrvChannel_channel.ChanAccess> e : t.getUsers().entrySet())
                Generic.curProtocol.outNOTICE(who, user, "    " + util.pad(e.getKey(), 14) + ": " + e.getValue());

        } else Generic.curProtocol.outNOTICE(who, user, "\u0002Error:\u0002 No such registered channel...");
    }
View Full Code Here


            if (Generic.Users.containsKey(args[1].toLowerCase())) {
                if (Generic.Users.get(args[1].toLowerCase()).authhandle != null) {
                    String u = Generic.Users.get(args[1].toLowerCase()).authhandle;
                    String ch = args[0].toLowerCase();
                    if (!temp.getChannels().containsKey(ch)) {
                        temp.getChannels().put(ch, new SrvChannel_channel(ch, u));
                        temp.getChannels().get(ch).getUsers().put(u, SrvChannel_channel.ChanAccess.C_OWNER);
                        ((SrvAuth) Configuration.getSvc().get(Configuration.authservice)).getUsers().get(u).WhereAccess.put(ch, SrvChannel_channel.ChanAccess.C_OWNER.toString());
                        temp.getChannels().get(ch).setMeta("_registered-by", Generic.Users.get(user.toLowerCase()).authhandle);
                        temp.getChannels().get(ch).setMeta("_ts_registered", util.getTS());
                        temp.getChannels().get(ch).setMeta("_ts_last", util.getTS());
View Full Code Here

TOP

Related Classes of ecks.services.SrvChannel_channel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.