/** * Returns a new Chat for sending private messages to a given room occupant. * The Chat's occupant address is the room's JID (i.e. roomName@service/nick). The server * service will change the 'from' address to the sender's room JID and delivering the message * to the intended recipient's full JID. * * @param occupant occupant unique room JID (e.g. 'darkcave@macbeth.shakespeare.lit/Paul'). * @return new Chat for sending private messages to a given room occupant. */ public Chat createPrivateChat(String occupant) { return new Chat(connection, occupant); }
var Chat = function() { console.log("init"); this.debug = function (txt) { console.log(txt); } this.keyPressedFunction = function(e){ console.log("keyPressed"); } this.sendText = function() { var texte = document.getElementById('shoutBoxInput').value; if (texte=="") return; document.getElementById('shoutBoxInput').value ="" this.debug("sendTexte:"+texte); } this.receiveText = function(username, texte) { } // place this at the end document.getElementById('shoutBoxInput').addEventListener("keydown", this.keyPressedFunction, false); } var chat = new Chat();
JDialog dialog = new JDialog((Dialog)null); // so if you say Chat extends JDialog, that would be: Chat dlg = new Chat((Dialog)null);
var chat = new Chat(); $(function() { chat.getState();
class User{ joinChat(chat,room){ chat.addUser(this,room); } } var chat=new Chat(); var user= new User(); user.joinChat(chat,room);
/** * Creates a new chat with the specified participant. The participant should * be a valid XMPP user such as <tt>jdoe@jivesoftware.com</tt> or * <tt>jdoe@jivesoftware.com/work</tt>. * * @param participant the person to start the conversation with. * @return a new Chat object. */ public Chat createChat(String participant) { if (!isConnected()) { throw new IllegalStateException("Not connected to server."); } return new Chat(this, participant); }
onCreate(Bundle saveInstance){ super.onCreate(); Chat chat = new Chat(); chat.someUniqueFuction(); }
private Chat createChat(String userJID, String threadID, boolean createdLocally) { Chat chat = new Chat(this, userJID, threadID); threadChats.put(threadID, chat); jidChats.put(userJID, chat); baseJidChats.put(StringUtils.parseBareAddress(userJID), chat); for(ChatManagerListener listener : chatManagerListeners) { listener.chatCreated(chat, createdLocally); } return chat; }
private Chat createChat(String userJID, String threadID, boolean createdLocally) { Chat chat = new Chat(this, userJID, threadID); threadChats.put(threadID, chat); jidChats.put(userJID, chat); baseJidChats.put(StringUtils.parseBareAddress(userJID), chat); for(ChatManagerListener listener : chatManagerListeners) { listener.chatCreated(chat, createdLocally); } return chat; }
private Chat createChat(String userJID, String threadID, boolean createdLocally) { Chat chat = new Chat(this, userJID, threadID); threadChats.put(threadID, chat); jidChats.put(userJID, chat); baseJidChats.put(StringUtils.parseBareAddress(userJID), chat); for(ChatManagerListener listener : chatManagerListeners) { listener.chatCreated(chat, createdLocally); } return chat; }
if (cursor != null && cursor.moveToLast()) { do { Chat chat = new Chat(); chat.setRecieverID(cursor.getString(cursor .getColumnIndex(DataProviderConstants.MESSAGE_RECEIVER_ID_COLUMN)));
iq.addChat(new Chat(with, start));
iq.addChat(new Chat(with, start));
public void test() throws Exception { // Create a MockWebServer. These are lean enough that you can create a new // instance for every unit test. MockWebServer server = new MockWebServer(); // Schedule some responses. server.enqueue(new MockResponse().setBody("hello, world!")); // Start the server. server.play(); // Ask the server for its URL. You'll need this to make HTTP requests. URL baseUrl = server.getUrl("/v1/chat/"); // Exercise your application code, which should make those HTTP requests. // Responses are returned in the same order that they are enqueued. Chat chat = new Chat(baseUrl); chat.loadMore(); assertEquals("hello, world!", chat.messages()); // Shut down the server. Instances cannot be reused. server.shutdown(); }