Homec4science

Add "serviceName" and "serviceType" to bot and chat logger

Authored by epriestley <git@epriestley.com> on Feb 18 2013, 16:50.

Description

Add "serviceName" and "serviceType" to bot and chat logger

Summary:
Make each adapter provide a "serviceType" (campfire, flowdock, IRC) and "serviceName" (irc network / chat server) so that we can disambiguate between, e.g., "#phabricator on EFNet" and "#phabricator on FreeNode".

Make the chatlog handler ship them over Conduit.

Also fix some "policy can not be null" bugs with chatlog recording.

Test Plan:
Verified data inserted correctly:

mysql> select * from chatlog_channel;
+----+------------------+-------------+--------------+------------+------------+-------------+--------------+
| id | serviceName      | serviceType | channelName  | viewPolicy | editPolicy | dateCreated | dateModified |
+----+------------------+-------------+--------------+------------+------------+-------------+--------------+
|  1 | irc.freenode.net | IRC         | #phabricator | users      | users      |  1361201689 |   1361201689 |
+----+------------------+-------------+--------------+------------+------------+-------------+--------------+
1 row in set (0.00 sec)

mysql> select * from chatlog_event where channelID = 1;
+----+--------------+------------+------------+------+---------------+--------------------------------+-----------+
| id | channel      | epoch      | author     | type | message       | loggedByPHID                   | channelID |
+----+--------------+------------+------------+------+---------------+--------------------------------+-----------+
| 45 | #phabricator | 1361201689 | epriestley | mesg | blip blip     | PHID-USER-5bt2phfepag4cdvjtzg5 |         1 |
| 46 | #phabricator | 1361201700 | epriestley | mesg | boop boop bip | PHID-USER-5bt2phfepag4cdvjtzg5 |         1 |
+----+--------------+------------+------------+------+---------------+--------------------------------+-----------+
2 rows in set (0.00 sec)

Reviewers: Afaque_Hussain, indiefan

Reviewed By: Afaque_Hussain

CC: aran

Maniphest Tasks: T837

Differential Revision: https://secure.phabricator.com/D4996

Details

Committed
epriestley <git@epriestley.com>Feb 18 2013, 16:50
Pushed
aubortJan 31 2017, 17:16
Parents
rPH57a9c3f07c6a: Improve Diviner handling of paths and remarkup
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPH4f2aa992483a: Add "serviceName" and "serviceType" to bot and chat logger (authored by epriestley <git@epriestley.com>).Feb 18 2013, 16:50