chat

Add element without namespace in smack message

為{幸葍}努か 提交于 2019-12-11 04:24:02
问题 I wants to add node element in smack Message . Eg. <myID> is the custom tag which i wants to add in message. like below structure <message to='username@domain' id='12345'><body>Hello</body><myID>33e6cf03-90aa-4281-a36e-902ccdf0657f</myID></message> What i tried so far By creating CustomExtension by implementing DefaultExtensionElement but here its creating message with some namespace specified. <message to='username@domain' id='12345'><body>Hello</body><myID xmlns='somenamespace'>33e6cf03

Having trouble with a simple Twisted chat server

好久不见. 提交于 2019-12-11 03:16:16
问题 When I try and run this (see code below) I get the "connection made" response from the server and the command prompt to write an input. However when I try and enter the input it just hangs and the server doesn't seem to receive the message. Anyone know why this is? Thanks, please say if this isn't clear enough Here is my chat server: from twisted.protocols import basic class MyChat(basic.LineReceiver): def connectionMade(self): print "Got new client!" self.factory.clients.append(self) def

QuickBlox 2.0 Chat dialog - how to detect an user join or leave group chat dialog?

做~自己de王妃 提交于 2019-12-11 03:15:25
问题 I have trouble with QuickBlox when update from version 1.2.4 to version 2.0. In version 2.0 how to detect a user join or leave group chat dialog? In version 1.2.4 i use ParticipantListener but version 2.2 QBGroupChat cant not add this listener ? Thank in advance. Version 1.2.4: PacketListener participantListener = new PacketListener() { @Override public void processPacket(Packet packet) { Presence presence = (Presence) packet; if (presence.getType() == Presence.Type.available) { // user

Why cannot use 2 separate foreign keys for same model in django model

橙三吉。 提交于 2019-12-11 03:07:51
问题 I have a theoretical model that isn't working: class Message(models.Model): text = models.TextField() created = models.DateTimeField(auto_now_add=True) sender = models.ForeignKey(User) receiver = models.ForeignKey(User) Now if a user messaged someone, like a private message thread, you have someone who sent it, and someone who received it, which is important to know. Both of these should be a one-to-many I think because each user can send infinite messages. Senders and receivers are users,

Python client side in chat

穿精又带淫゛_ 提交于 2019-12-11 02:55:39
问题 I have a problem while trying to build the client side of a chat. I just in the begining, this is my code: import socket my_socket = socket.socket(socket.AF_INET,socket.SOCK_STREAM) my_socket.connect(("10.10.10.69",1234)) while True: message=raw_input("your message: ") if(message=="quit"): my_socket.close() break my_socket.send(message) data=my_socket.recv(1024) print "message from server:" , data The problem is the raw_input . When a user sends a message the other users are stacked on the

ListView Rowlayout in a own coded Chat

冷暖自知 提交于 2019-12-11 00:48:33
问题 What I'm trying to do I'm trying to create a chat which has to diffrent row's. For every row I made a own layout file, but the problem is that the layoutfile of one row dosn't fit the screen. Question What do I need to change in the row layout that it fits like it should. You'll find the code and also a printscreen of what I'm trying. Code ListAdapter public class ChatListAdapter extends BaseAdapter { private ArrayList<String> ContentList; private ArrayList<Integer> ChatUserList; private

chat server: what's the best(optimized) way to save a conversation log

末鹿安然 提交于 2019-12-10 21:04:37
问题 I'm building a simple chat server in java , where users can have private conversations with each other. I want to save those conversation at a server level(not on client side) so I can list them to the users as a conversation log service. I'm also using MySQL as a database in my software. What I'm looking is an optimized way to save those conversations and also a fast way to list them later. So far I've thought on 2 implementations. using the MySQL database and a) save the conversation in a

socket.io multiple chats on one page

点点圈 提交于 2019-12-10 20:23:50
问题 I want to implement multiple chat windows on one page (like facebook for e.g.). Currently using "rooms", simplified code: [client] socket.emit('join', 'room1'); socket.emit('join', 'room2'); [server] socket.on('join', function(room) { socket.join(room); }); so each separate room on client, it is a separate class that handles the chat logic, it must receive events from server only for connected room. But if it is one page, then one socket connection used, so if one socket will connect to

Visual Basic UDPClient Server/Client model?

拈花ヽ惹草 提交于 2019-12-10 18:34:45
问题 So I'm trying to make a very simple system to send messages from a client to a server (and later on from server to client as well, but baby steps first). I'm not sure exactly how to use UDPClient to send and receive messages (especially to receive them), mostly because I don't have anything triggering the ReceiveMessage() function and I'm not sure what would. Source Code is at this link, go to File>Download. It is already built if you want to just run the exe. So my question is basically: How

Set the chat/Avatar in QuickBlox QBUUser in iOS Chat

天大地大妈咪最大 提交于 2019-12-10 17:34:56
问题 Here in QuickBlox we get the QBUUser instance of each user registered with the QuickBlox . But i did not found any property to set the avatar url for profile photo and update it. I was thinking to set url in property customData . Is this right way to set avatar Url or if any other way exist let me know. Thanks in Advance. 回答1: Finally i satisfied with customData property in QBUUser. I just created a dictionary and set url in that dictionary within some Key. Than created its JSON string and