messaging

Laravel 4 Relationship: messaging system

核能气质少年 提交于 2019-12-07 02:38:31
I followed the suggestions from user ehp in order to build a lightweight messaging-system: https://stackoverflow.com/a/18717864/1084315 Users: id | username Messages: id | from | content user_messages: user_id | message_id class User extends Eloquent { public function messages() { return $this->belongsToMany('Message'); } public function sent_messages() { return $this->hasMany('Messages', 'from'); } } class Message extends Eloquent { public function from() { return $this->belongsTo('User', 'from'); } public function to() { return $this->belongsToMany('User'); } } I create a message like this:

Is there a way to use GCM in Android without a dedicated server?

心已入冬 提交于 2019-12-07 01:09:15
问题 I am conceptualizing an Android app that sends data from one device to another (like a picture message), but because I do not have a server, I am looking into other ways of messaging. Google Cloud Messaging (GCM) seems like a good choice, since its made for Android, and is free to use, but it still requires a server to use. Is there a way around this requirement- such as running the GCM server on the app itself? Or is there a better approach to serverless messaging on Android? 回答1: I think

How to Send message to a WhatsApp group without opening WhatsApp?

只愿长相守 提交于 2019-12-06 21:55:39
Is it possible to send message using the WhatsApp server to a WhatsApp group, inside my own application and without opening the WhatsApp app? Also please help me regarding the history of WhatsApp contact chat. in short NO Reason: because (at least to my knowledge) Whatsapp does not allows the same. i.e. no external events or APIs to implement the same. So you have to at least use the intents and let the user handle the rest. Also please help me regarding the history of WhatsApp contact chat. This also can't be done (using ethical approach) because all the chat history is stored in a private

How to get the message from temporary Queue in Different session

会有一股神秘感。 提交于 2019-12-06 19:42:28
i am new to jms and activemq. i produce one message to one static queue in activemq and get reply back to temporary queue using getJMSReplyTo. the code is following ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616"); // Create a Connection Connection connection = connectionFactory.createConnection(); connection.start(); // Create a Session Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); // Create the destination (Topic or Queue) Destination destination = (Destination) session.createQueue("PostWithParameter_Queue");

Getting the most recent message in a thread

早过忘川 提交于 2019-12-06 18:48:29
问题 I have a query that gets all the info I need for a messaging system's main page (including unread message count, etc)... but it currently retrieves the original threads message. I would like to augment the below query to grab the most recent message in each thread instead. This query is very close, however my mediocre SQL skills are keeping me from wrapping things up... $messages = array(); $unread_messages_total = 0; $messages_query = " SELECT m.* , COUNT(r.id) AS num_replies , MAX(r

Android google cloud messaging sample not working

自闭症网瘾萝莉.ら 提交于 2019-12-06 11:59:58
问题 Im following the tutorial here http://developer.android.com/google/gcm/gs.html in order to setup GCM. Im currently in the process of trying to register the device. However, for some reason, the application always seems to crash at gcm = GoogleCloudMessaging.getInstance(this); The stacktrace seems to point at the following: 06-18 13:42:20.909: I/dalvikvm(11613): Could not find method com.google.android.gms.gcm.GoogleCloudMessaging.getInstance, referenced from method pushNotification

How can SQLServer notify a vb.net application of an event?

时光怂恿深爱的人放手 提交于 2019-12-06 11:51:57
Is there a relatively simple way that my VB.NET application can be notified of the fact that a new value has been written to a table in SQL Server Express 2008? Polling is not an option since I'd need to do that every 10 seconds nonstop. Take a look at having your application subscribe to Query Notifications . Also Using Query Notifications in .NET 2.0 to handle ad-hoc data refreshes 来源: https://stackoverflow.com/questions/6617278/how-can-sqlserver-notify-a-vb-net-application-of-an-event

MySQL GROUP BY / ORDER BY issue with flat messages table / threads

白昼怎懂夜的黑 提交于 2019-12-06 08:10:38
Ok, I'm trying to base something similar off of this, but not quite getting it nailed: GROUP BY and ORDER BY Basically, wanting a query to find the latest messages in each 'thread' between the current logged-in user and any other users, but via a flat (non-'threaded') table of messages: messages { id, from_uid, to_uid, message_text, time_added } Assuming the current user's uid is '1', and the latest message in each 'thread' could either be from that user, or to that user (the other party always denoted by thread_recipient): SELECT a.*,thread_recipient FROM messages a JOIN (SELECT IF(from_uid =

how do I handle messages asynchronously, throwing away any new messages while processing?

∥☆過路亽.° 提交于 2019-12-06 05:08:09
I have a C# app that subscribes to a topic on our messaging system for value updates. When a new value comes in, I do some processing and then carry on. The problem is, the updates can come faster than the app can process them. What I want to do is to just hold on to the latest value, so I don't want a queue. For example, the source publishes value "1" and my app receives it; while processing, the source publishes the sequence (2, 3, 4, 5) before my app is done processing; my app then processes value "5", with the prior values thrown away. It's kind of hard to post a working code sample since

How are different events handled in Azure Event Hubs?

隐身守侯 提交于 2019-12-06 04:39:27
Different event types are discriminated by some combination of topics/queues and message headers. In Kafka, record streams are still separated out as topics ( https://kafka.apache.org/intro ). In going through the Azure Event Hubs documentation, I do not see any such idea called out. There are partitions, but these are related to consumer parallelism ( https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-what-is-event-hubs#partitions ), according to the documentation. Is the idea that you would one namespace in Azure Event Hubs, which contains an Event Hub for each "topic"? Yes. I