This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const unreadMessageCountList = {}; // Stores the unreadCount for each and every message. | |
const currentMessageList = [{ | |
message: object | |
}, { | |
message: object | |
}]; | |
const handler = new sb.ChannelHandler(); | |
handler.onReadReceiptUpdated = (groupChannel) => { | |
processUnreadMessageCount(groupChannel); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const processUnreadMessageCount = (groupChannel) => { | |
currentMessageList.forEach(message => { | |
const unreadMembers = groupChannel.getUnreadMembers(message); | |
unreadMessageCountList[message.messageId] = unreadMembers.length; | |
}); | |
return unreadMessageList; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sendMessage = (message, groupChannel) => { | |
const params = new sb.UserMessageParams(); | |
params.message = message; | |
groupChannel.sendUserMessage(params, function (message, error) { | |
if (error) return; | |
currentMessageList.push(message) | |
processOneUnreadMessageCount(groupChannel, message) | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const processOneUnreadMessageCount = (groupChannel, message) => { | |
const unreadMembers = groupChannel.getUnreadMembers(message); | |
unreadMessageCountList[message.messageId] = unreadMembers.length; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ss = SpreadsheetApp.openById("SPREADSHEET_ID"); | |
var rawDataSheet = ss.getSheetByName("Sheet1") | |
function updateSpreadSheet(e) { | |
try { | |
var data = JSON.stringify(e.postData); | |
var json = JSON.parse(data); | |
var contents = json.contents; | |
var webhookType = JSON.parse(contents).category; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1,36 +1,37 @@ | |
/** | |
* Copyright 2016 Google Inc. All Rights Reserved. | |
* <p> | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* <p> | |
* http://www.apache.org/licenses/LICENSE-2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SearchMembers { | |
constructor(channel) { | |
this.targetChannel = channel; | |
this.dictionary = {}; | |
} | |
addQueryUsersToDictionary(users, searchTerm) { | |
if (users.length === 0) { | |
this.dictionary[searchTerm] = {}; | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SearchUsers { | |
constructor(sb) { | |
this.sb = sb; | |
this.lookupDictionary = {}; | |
this.userDictionary = {}; | |
} | |
addQueryUsersToDictionary(users, searchTerm) { | |
if (users.length === 0) { | |
this.lookupDictionary[searchTerm] = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<title>React App</title> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// AlertManager.swift | |
// uikitsimple | |
// | |
// Copyright © 2020 SendBird, Inc. All rights reserved. | |
// | |
import UIKit | |
// This function handles alertController to be used in the sample app. |
OlderNewer