I think this would be a good idea also
NOOOOOOOO
I'd rather strip smilies from messages than have them be displayed graphically.
Posted 30 May 2012 - 06:58 PM
I think this would be a good idea also
Posted 30 May 2012 - 07:55 PM
Posted 30 May 2012 - 09:22 PM
Posted 03 June 2012 - 02:14 PM
Things went a bit screwy in my life in the week after that, and I've yet to find time to get that all done; if you could put the prefixes here, I should be able to have them implemented soon.
Posted 13 August 2012 - 11:26 PM
Posted 15 August 2012 - 03:42 PM
Posted 15 August 2012 - 07:36 PM
Posted 15 August 2012 - 08:34 PM
indeed it had been cut off, I edited it back. Another IPB bug I presume, whatever....
//This is all to play with 2072's mind (and it's also good for 'reducing' code size)
Posted 17 August 2012 - 07:55 AM
Just posted to say it's something with the chat widget, encoding, etc. Whenever you copy text from chat widget there are some zero (0x00) characters together with your text. Try copy-pasting text from it into a hex editor.indeed it had been cut off, I edited it back. Another IPB bug I presume, whatever....
Posted 17 August 2012 - 10:05 PM
Posted 25 August 2012 - 10:06 PM
Yes, that will be fairly trivial. Ofc, here is the original comment for the code:
//This is all to play with 2072's mind (and it's also good for 'reducing' code size)
Posted 26 August 2012 - 12:25 AM
Posted 02 November 2012 - 01:07 AM
Edited by Forty-Two, 02 November 2012 - 02:32 AM.
Fixed unreadable colors :P
Posted 02 November 2012 - 01:27 AM
Posted 02 November 2012 - 02:15 AM
Posted 02 November 2012 - 01:20 PM
Posted 02 November 2012 - 02:00 PM
RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} ^/p[0-9]+$ RewriteRule [0-9]+ http://community.casiocalc.org/?act=findpost&pid=$0 [R=301,L] RewriteCond %{REQUEST_URI} ^/t[0-9]+$ RewriteRule [0-9]+ http://community.casiocalc.org/topic/$0- [R=301,L]
Posted 02 November 2012 - 02:05 PM
Posted 02 November 2012 - 02:22 PM
Posted 02 November 2012 - 02:49 PM
Posted 03 November 2012 - 11:52 AM
Posted 03 November 2012 - 02:17 PM
Posted 03 November 2012 - 03:47 PM
But the onsite widget would still show the notifications, right?
Posted 03 November 2012 - 03:51 PM
Posted 18 December 2012 - 06:43 PM
Posted 26 December 2012 - 11:47 PM
Posted 27 December 2012 - 01:21 AM
Where's the bot gone?
Posted 29 December 2012 - 10:24 AM
Posted 01 January 2013 - 03:47 PM
Where's the bot gone?
Posted 06 January 2013 - 01:13 PM
Posted 06 January 2013 - 10:37 PM
Feature Request: Clickable user names for users that use the widget (not using IRC clients), which links to their profile page.
Useful for getting familiar with new users. (And an alternative way to view your own profile )
Posted 18 January 2013 - 09:10 PM
Posted 18 January 2013 - 10:20 PM
Posted 26 January 2013 - 09:23 AM
Posted 26 January 2013 - 09:59 PM
Posted 27 January 2013 - 05:39 PM
<Forty-Two> ohai
@Override public void onMessage(String channel, String sender, String login, String hostname, String message) { if(!(talkChannel.equals(channel))) return; //If it's not in the channel we are talking in, return if(sender.equals(getName())) return; //If it's us, return manager.handleSay(sender, message); //Call the manager's handle say method logger.trace(">>> ["+sender+"] "+message) //Log the message }
public void handleSay(String user, String message) { for(MessageHandler handler:handlers){ //Iterate over all handlers handler.handleSay(user, message); //Call the handleSay method of them } }
public void handleSay(String user, String message) addMessage(user, message, Common.SAY); //Add the message to the queue }
private void addMessage(String user, String message, int type){ long time= System.currentTimeMillis(); //Get the time; this is necessary for the protocol JSONObject object= new JSONObject(); //This is what we use to wrap the message in try{ object.put("time", time); //First put the current time object.put("user", Common.escape(user)); //Then put the user doing the action. In this case, "Forty-Two" object.put("message", Common.escape(message)); //Put the message "ohai" object.put("type", type); //Put the type of message: 0 for errors (never used at my end, but still part of the protocol), 1 for messages (When someone says something), 2 for channel events (Someone joins or parts the channel), and 3 for actions (the /me command) synchronized(lock){ //Make sure we are the only thread accssing the queue queue.add(object.toString()); //Add the object } logger.trace("Added the message \""+object.toString()+"\" to the queue"); //Lg it } catch(JSONException e){ //error handling logger.warn("Unable to format the message into JSON: "+e.getMessage()); return; } }
private void flush(){ if(queue.isEmpty()) return; //Don't even bother if the queue is empty logger.debug("Flushing messages"); synchronized (lock){ //Make sure no one else touches the queue while we're using it String messageDigest= Common.getHash(queue); //Get digest in hex String random= Common.randomString(); //Get a random string to use for security String key= random+Common.SALT+messageDigest; //Put these all together String outDigest= Common.toHex(Common.getMessageDigest().digest(key.getBytes())); //Compute the digest to send HttpURLConnection connection; try{ URL url= new URL("http://api.casiocalc.org/CasioIRCEventReceiver.php?AuthChallengeRandom="+random+"&AuthChallengeKey="+outDigest); //The authentication parameters are passed in the url, similar to the GET method connection = (HttpURLConnection) url.openConnection(); //Set the connection.setDoOutput(true); //No idea >.> connection.setDoInput(true); //Gonna have to refresh my knowledge of the api connection.setRequestMethod("POST"); //This is so we can stick stuff in the body, like when you fill out a form PrintStream out= new PrintStream(connection.getOutputStream()); //Open a stream to the output for (String line : queue) { //For every line in the queue... out.println(line); //...print it } out.close(); //Close the output stream once were done with it } //Handle them errors catch(MalformedURLException e){ log("Malformed URL: "+e.getMessage()); return; } catch(ProtocolException e){ log("Error in Protocol: "+e.getMessage()); return; } catch(IOException e){ log("I/O Error: "+e.getMessage()); return; } try{ //This is where we check for errors when we authenticated BufferedReader in= new BufferedReader(new InputStreamReader(connection.getInputStream())); //Get a stream for(String line= in.readLine(); line!=null; line= in.readLine()){ //Read off the output so we can log it logger.trace("RESP: "+line); } switch(connection.getResponseCode()){ case HttpURLConnection.HTTP_OK: break; //It worked! case HttpURLConnection.HTTP_BAD_REQUEST: log("Malformed data"); return; //This is the response if the json is wrong case HttpURLConnection.HTTP_UNAUTHORIZED: log("Unable to authenticate"); return; //This is what happens if we get the auth wrong (Oh noes!) } } //More error handling catch(MalformedURLException e){ log("Malformed URL: "+e.getMessage()); } catch(ProtocolException e){ log("Error in Protocol: "+e.getMessage()); } catch(IOException e){ log("I/O Error: "+e.getMessage()); } finally{ queue.clear(); //Make sure the queue gets cleared } }
Posted 27 January 2013 - 05:58 PM
<Forty-Two> ohai
public void handle(HttpExchange exchange) throws IOException { logger.trace("Recieved request from "+exchange.getRemoteAddress().getHostName()); if(!(exchange.getRequestMethod().equals("POST"))){ //If the request was not post, return an error sendError(exchange, "Bad method: "+exchange.getRequestMethod(), HttpURLConnection.HTTP_BAD_METHOD); return; } BufferedReader body= new BufferedReader(new InputStreamReader(exchange.getRequestBody())); //Create a new bufferedreader that updates the MessageDigest LinkedList<String> buffer= new LinkedList<String>(); //Read the lines into a buffer for(String line= body.readLine(); line!=null; line= body.readLine()) { buffer.add(line); logger.trace("RECV: "+line); } Headers headers= exchange.getRequestHeaders(); //Get the headers String random= headers.getFirst("AuthChallengeRandom"); String inDigest= headers.getFirst("AuthChallengeKey"); String messageDigest= Common.getHash(buffer); //Compute our message digest String key= random+Common.SALT+messageDigest; //Add everything togather String outDigest= Common.toHex(Common.getMessageDigest().digest(key.getBytes())); //This should match the digest that the casiocalc server sent us logger.trace("Input Digest: "+inDigest+" Random: "+random+" Message Digest: "+messageDigest+" Computed Digest: "+outDigest); if(!(outDigest.equals(inDigest))){ //If they're not equal, complain sendError(exchange, "Invalid digest: "+inDigest, HttpURLConnection.HTTP_UNAUTHORIZED); return; } for(String line: buffer){ //Parse each line from the server try { JSONObject json = new JSONObject(line); //Create a new object for each line String user= json.getString("user"); //Get the user ("Forty-Two") String message= json.getString("message"); //The message ("ohai") int type= json.getInt("type"); //And the message type (1); we ignore the time parameter, though it is still passed switch(type){ //Switch for message types and pass it on to the bot (actually the BotManager) case 0: bot.error(message); break; case 1: bot.say(user, message); break; //Evals to true case 2: bot.channel(user, message); break; case 3: bot.action(user, message); break; default: logger.debug("Invalid message type: "+type); break; } } catch (JSONException e) { logger.debug("Unable to parse line from server: "+line); } } exchange.sendResponseHeaders(HttpURLConnection.HTTP_OK, 0); //Wrap it up exchange.close(); //Close it when we're done }
/** * Sends a message from a user in the form of<br /> * <pre>[user] message</pre> * @param user The user to send from * @param message The message to send */ public void say(String user, String message){ bot.say(user, message); }
public void say(String user, String message){ logger.trace(">>> ["+user+"] "+message); sendMessage("["+user+"] "+message); //Calls the sendMessage method, which overloads the super's sendMessage method }
private void sendMessage(String message){ if(!(isConnected())) chatReconnect(); //If we aren't connected, reconnect if(!(Common.hasString(getChannels(), talkChannel))) joinChannel(talkChannel); //If we aren't in the channel, join it sendMessage(talkChannel, message); //Send the message to the channel }
Posted 02 February 2013 - 04:08 PM
Posted 02 February 2013 - 11:21 PM
Posted 08 February 2013 - 04:29 PM
0 members, 1 guests, 0 anonymous users