Unify huddles and personals into private messages on the send path
Personals are now just private messages between two people (which sometimes manifests as a private message with one recipient). The new message type on the send path is 'private'. Note that the receive path still has 'personal' and 'huddle' message types. (imported from commit 97a438ef5c0b3db4eb3e6db674ea38a081265dd3)
This commit is contained in:
parent
8a76560970
commit
73daa73887
|
@ -57,7 +57,7 @@ if child_pid == 0:
|
|||
# Run the humbug => zephyr mirror in the child
|
||||
time.sleep(3)
|
||||
humbug_client.send_message({
|
||||
"type": "personal",
|
||||
"type": "private",
|
||||
"content": str(hzkey1),
|
||||
"recipient": humbug_user,
|
||||
});
|
||||
|
|
|
@ -128,7 +128,7 @@ def send_reminders():
|
|||
message = 'Reminder:\n\n' + '\n'.join('* ' + m for m in messages)
|
||||
|
||||
humbug.send_message(dict(
|
||||
type = 'personal',
|
||||
type = 'private',
|
||||
recipient = options.user,
|
||||
content = message))
|
||||
|
||||
|
|
|
@ -247,10 +247,10 @@ def process_notice(notice, log):
|
|||
'zsig' : zsig, # logged here but not used by app
|
||||
'content' : body }
|
||||
if is_huddle:
|
||||
zeph['type'] = 'personal'
|
||||
zeph['type'] = 'private'
|
||||
zeph['recipient'] = huddle_recipients
|
||||
elif is_personal:
|
||||
zeph['type'] = 'personal'
|
||||
zeph['type'] = 'private'
|
||||
zeph['recipient'] = to_humbug_username(notice.recipient)
|
||||
else:
|
||||
zeph['type'] = 'stream'
|
||||
|
@ -261,7 +261,7 @@ def process_notice(notice, log):
|
|||
zeph["subject"] = '(instance "%s")' % (notice.instance,)
|
||||
|
||||
# Add instances in for instanced personals
|
||||
if zeph['type'] == "personal" and notice.instance.lower() != "personal":
|
||||
if zeph['type'] == "private" and notice.instance.lower() != "personal":
|
||||
zeph["content"] = "[-i %s]" % (notice.instance,) + "\n" + zeph["content"]
|
||||
|
||||
zeph = decode_unicode_byte_strings(zeph)
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
curl https://humbughq.com/api/v1/send_message \
|
||||
-d "api-key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
|
||||
-d "email=tabbott@humbughq.com" \
|
||||
-d "type=personal" -d "content=test" \
|
||||
-d "type=private" -d "content=test" \
|
||||
-d "recipient=tabbott@humbughq.com"
|
||||
|
||||
curl https://humbughq.com/api/v1/get_messages \
|
||||
|
|
|
@ -31,7 +31,7 @@ client = api.common.HumbugAPI(email=options.user,
|
|||
site=options.site)
|
||||
|
||||
message_data = {
|
||||
"type": "personal",
|
||||
"type": "private",
|
||||
"content": "test",
|
||||
"recipient": "tabbott@humbughq.com",
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue