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:
Zev Benjamin 2012-11-07 18:38:21 -05:00
parent 8a76560970
commit 73daa73887
5 changed files with 7 additions and 7 deletions

View file

@ -57,7 +57,7 @@ if child_pid == 0:
# Run the humbug => zephyr mirror in the child # Run the humbug => zephyr mirror in the child
time.sleep(3) time.sleep(3)
humbug_client.send_message({ humbug_client.send_message({
"type": "personal", "type": "private",
"content": str(hzkey1), "content": str(hzkey1),
"recipient": humbug_user, "recipient": humbug_user,
}); });

View file

@ -128,7 +128,7 @@ def send_reminders():
message = 'Reminder:\n\n' + '\n'.join('* ' + m for m in messages) message = 'Reminder:\n\n' + '\n'.join('* ' + m for m in messages)
humbug.send_message(dict( humbug.send_message(dict(
type = 'personal', type = 'private',
recipient = options.user, recipient = options.user,
content = message)) content = message))

View file

@ -247,10 +247,10 @@ def process_notice(notice, log):
'zsig' : zsig, # logged here but not used by app 'zsig' : zsig, # logged here but not used by app
'content' : body } 'content' : body }
if is_huddle: if is_huddle:
zeph['type'] = 'personal' zeph['type'] = 'private'
zeph['recipient'] = huddle_recipients zeph['recipient'] = huddle_recipients
elif is_personal: elif is_personal:
zeph['type'] = 'personal' zeph['type'] = 'private'
zeph['recipient'] = to_humbug_username(notice.recipient) zeph['recipient'] = to_humbug_username(notice.recipient)
else: else:
zeph['type'] = 'stream' zeph['type'] = 'stream'
@ -261,7 +261,7 @@ def process_notice(notice, log):
zeph["subject"] = '(instance "%s")' % (notice.instance,) zeph["subject"] = '(instance "%s")' % (notice.instance,)
# Add instances in for instanced personals # 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["content"] = "[-i %s]" % (notice.instance,) + "\n" + zeph["content"]
zeph = decode_unicode_byte_strings(zeph) zeph = decode_unicode_byte_strings(zeph)

View file

@ -4,7 +4,7 @@
curl https://humbughq.com/api/v1/send_message \ curl https://humbughq.com/api/v1/send_message \
-d "api-key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -d "api-key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-d "email=tabbott@humbughq.com" \ -d "email=tabbott@humbughq.com" \
-d "type=personal" -d "content=test" \ -d "type=private" -d "content=test" \
-d "recipient=tabbott@humbughq.com" -d "recipient=tabbott@humbughq.com"
curl https://humbughq.com/api/v1/get_messages \ curl https://humbughq.com/api/v1/get_messages \

View file

@ -31,7 +31,7 @@ client = api.common.HumbugAPI(email=options.user,
site=options.site) site=options.site)
message_data = { message_data = {
"type": "personal", "type": "private",
"content": "test", "content": "test",
"recipient": "tabbott@humbughq.com", "recipient": "tabbott@humbughq.com",
} }