Changeset - c358589ec5c0
[Not reviewed]
0 1 0
Jan Kaluza - 9 years ago 2016-02-01 10:08:18
jkaluza@redhat.com
Slack: Ignore purpose messages for now
1 file changed with 4 insertions and 0 deletions:
0 comments (0 inline, 0 general)
spectrum/src/frontends/slack/SlackRTM.cpp
Show inline comments
 
@@ -104,12 +104,13 @@ void SlackRTM::handlePayloadReceived(const std::string &payload) {
 

	
 
	if (type == "message") {
 
		STORE_STRING(d, channel);
 
		STORE_STRING(d, text);
 
		STORE_STRING(d, ts);
 
		STORE_STRING_OPTIONAL(d, subtype);
 
		STORE_STRING_OPTIONAL(d, purpose);
 

	
 
		rapidjson::Value &attachments = d["attachments"];
 
		if (attachments.IsArray()) {
 
			for (int i = 0; i < attachments.Size(); i++) {
 
				STORE_STRING_OPTIONAL(attachments[i], fallback);
 
				if (!fallback.empty()) {
 
@@ -126,12 +127,15 @@ void SlackRTM::handlePayloadReceived(const std::string &payload) {
 
			text = "/me " + text;
 
			STORE_STRING(d, user);
 
			onMessageReceived(channel, user, text, ts);
 
		}
 
		else if (subtype == "channel_join") {
 
			
 
		}
 
		else if (!purpose.empty()) {
 
			
 
		}
 
		else {
 
			STORE_STRING(d, user);
 
			onMessageReceived(channel, user, text, ts);
 
		}
 
	}
0 comments (0 inline, 0 general)