Skip to content

Commit 0a09f5b

Browse files
committed
Closes #233 Add Piwik Analytics
Piwik Analytics
2 parents f83bb65 + 943f026 commit 0a09f5b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1368
-57
lines changed

.meteor/packages

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ rocketchat:migrations
7373
rocketchat:oauth2-server-config
7474
rocketchat:oembed
7575
rocketchat:otr
76+
rocketchat:piwik
7677
rocketchat:push-notifications
7778
rocketchat:reactions
7879
rocketchat:slashcommands-invite

.meteor/versions

+1
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ rocketchat:[email protected]
169169
170170
171171
172+
172173
173174
174175

packages/rocketchat-channel-settings/client/views/channelSettings.coffee

+17-14
Original file line numberDiff line numberDiff line change
@@ -83,38 +83,41 @@ Template.channelSettings.onCreated ->
8383
return true
8484

8585
@saveSetting = =>
86+
room = ChatRoom.findOne @data?.rid
8687
switch @editing.get()
8788
when 'roomName'
88-
room = ChatRoom.findOne @data?.rid
8989
if $('input[name=roomName]').val() is room.name
9090
toastr.success TAPi18n.__ 'Room_name_changed_successfully'
91+
RocketChat.callbacks.run 'roomNameChanged', ChatRoom.findOne(room._id)
9192
else
9293
if @validateRoomName()
93-
Meteor.call 'saveRoomSettings', @data?.rid, 'roomName', @$('input[name=roomName]').val(), (err, result) ->
94-
if err
95-
return handleError(err)
94+
RocketChat.callbacks.run 'roomNameChanged', { _id: room._id, name: @$('input[name=roomName]').val() }
95+
Meteor.call 'saveRoomSettings', room._id, 'roomName', @$('input[name=roomName]').val(), (err, result) ->
96+
return handleError err if err
9697
toastr.success TAPi18n.__ 'Room_name_changed_successfully'
9798
when 'roomTopic'
9899
if @validateRoomTopic()
99-
Meteor.call 'saveRoomSettings', @data?.rid, 'roomTopic', @$('input[name=roomTopic]').val(), (err, result) ->
100-
if err
101-
return handleError(err)
100+
Meteor.call 'saveRoomSettings', room._id, 'roomTopic', @$('input[name=roomTopic]').val(), (err, result) ->
101+
return handleError err if err
102102
toastr.success TAPi18n.__ 'Room_topic_changed_successfully'
103+
RocketChat.callbacks.run 'roomTopicChanged', ChatRoom.findOne(result.rid)
103104
when 'roomType'
104105
if @validateRoomType()
105-
Meteor.call 'saveRoomSettings', @data?.rid, 'roomType', @$('input[name=roomType]:checked').val(), (err, result) ->
106-
if err
107-
return handleError(err)
106+
RocketChat.callbacks.run 'roomTypeChanged', room
107+
Meteor.call 'saveRoomSettings', room._id, 'roomType', @$('input[name=roomType]:checked').val(), (err, result) ->
108+
return handleError err if err
108109
toastr.success TAPi18n.__ 'Room_type_changed_successfully'
109110
when 'archivationState'
110111
if @$('input[name=archivationState]:checked').val() is 'true'
111-
if ChatRoom.findOne(@data.rid)?.archived isnt true
112-
Meteor.call 'archiveRoom', @data?.rid, (err, results) ->
112+
if room.archived isnt true
113+
Meteor.call 'archiveRoom', room._id, (err, results) ->
113114
return handleError err if err
114115
toastr.success TAPi18n.__ 'Room_archived'
116+
RocketChat.callbacks.run 'archiveRoom', ChatRoom.findOne(room._id)
115117
else
116-
if ChatRoom.findOne(@data.rid)?.archived is true
117-
Meteor.call 'unarchiveRoom', @data?.rid, (err, results) ->
118+
if room.archived is true
119+
Meteor.call 'unarchiveRoom', room._id, (err, results) ->
118120
return handleError err if err
119121
toastr.success TAPi18n.__ 'Room_unarchived'
122+
RocketChat.callbacks.run 'unarchiveRoom', ChatRoom.findOne(room._id)
120123
@editing.set()

packages/rocketchat-channel-settings/server/methods/saveRoomSettings.coffee

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ Meteor.methods
3333
when 'default'
3434
RocketChat.models.Rooms.saveDefaultById rid, value
3535

36-
return true
36+
return { result: true, rid: room._id }

packages/rocketchat-lib/client/methods/sendMessage.coffee

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Meteor.methods
44
return false
55

66
if _.trim(message.msg) isnt ''
7-
87
if isNaN(TimeSync.serverOffset())
98
message.ts = new Date()
109
else
@@ -19,5 +18,5 @@ Meteor.methods
1918
message = RocketChat.callbacks.run 'beforeSaveMessage', message
2019

2120
RocketChat.promises.run('onClientMessageReceived', message).then (message) ->
22-
2321
ChatMessage.insert message
22+
RocketChat.callbacks.run 'afterSaveMessage', message

packages/rocketchat-lib/i18n/ar.i18n.json

+9-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
"Accounts_OAuth_Custom_Secret" : "سر",
5050
"Accounts_OAuth_Custom_Token_Path" : "مسار رمزي",
5151
"Accounts_OAuth_Custom_Token_Sent_Via" : "رمزي المرسلة عن طريق",
52-
"Accounts_OAuth_Custom_URL" : "الرابط",
5352
"Accounts_OAuth_Facebook" : "تسجيل الدخول الى الفيسبوك",
5453
"Accounts_OAuth_Facebook_callback_url" : "URL الفيسبوك الاستدعاء",
5554
"Accounts_OAuth_Facebook_id" : "الفيسبوك معرف التطبيق",
@@ -127,6 +126,10 @@
127126
"All_messages" : "كل الرسائل",
128127
"Allow_Invalid_SelfSigned_Certs" : "السماح بالشهادات غير الصالحة الموقعة ذاتيا",
129128
"Allow_Invalid_SelfSigned_Certs_Description" : "السماح لشهادة SSL غير صحيحة وموقعة ذاتيا للتأكد من صحة الرابط ومعاينات.",
129+
"Analytics_features_enabled" : "الميزات الممكنة",
130+
"Analytics_features_messages_Description" : "يتابع أحداث مخصصة ذات الصلة إلى إجراءات المستخدم لا على الرسائل.",
131+
"Analytics_features_rooms_Description" : "يتابع أحداث مخصصة تتعلق الإجراءات على قناة أو مجموعة (خلق، وترك، وحذف).",
132+
"Analytics_features_users_Description" : "يتابع أحداث مخصصة تتعلق الإجراءات ذات الصلة للمستخدمين (مرات إعادة تعيين كلمة المرور، الشخصية تغيير الصورة، الخ).",
130133
"and" : "و",
131134
"And_more" : "وأكثر من ذلك __length __",
132135
"Animals_and_Nature" : "حيوانات و طبيعة",
@@ -279,6 +282,7 @@
279282
"Direct_Messages" : "الرسائل المباشرة",
280283
"Displays_action_text" : "نص العمل يعرض",
281284
"Do_you_want_to_change_to_s_question" : "هل تريد التغيير إلى <strong>%s</strong>؟",
285+
"Domains" : "المجالات",
282286
"Drop_to_upload_file" : "إسقاط لتحميل الملف",
283287
"Dry_run" : "تنفيذ تجريبي",
284288
"Dry_run_description" : "سيتم إرسال رسالة بريدية واحدة إلى نفس العنوان الموجود في خانة \"من\". تأكد من كون ذلك العنوان البريدي فعال",
@@ -388,6 +392,7 @@
388392
"False" : "لا",
389393
"Favorite_Rooms" : "تمكين تفضيل الغرف",
390394
"Favorites" : "المفضلة",
395+
"Features_Enabled" : "الميزات الممكنة",
391396
"Field" : "حقل",
392397
"Field_removed" : "إزالة الميدان",
393398
"File_exceeds_allowed_size_of_bytes" : "يتجاوز حجم الملف المسموح به بايت __size__",
@@ -772,6 +777,8 @@
772777
"Pin_Message" : "تثبيث الرسالة",
773778
"Pinned_a_message" : "دبس رسالة:",
774779
"Pinned_Messages" : "رسائل مثبتة",
780+
"PiwikAnalytics_siteId_Description" : "هوية الموقع لاستخدامها لتحديد هذا الموقع. على سبيل المثال: 17",
781+
"PiwikAnalytics_url_Description" : "عنوان الموقع حيث يتواجد Piwik، ومن المؤكد أن تشمل مائلة للتجريب. على سبيل المثال: //piwik.rocket.chat/",
775782
"Placeholder_for_email_or_username_login_field" : "نائب عن البريد الإلكتروني أو تسجيل الدخول باسم المستخدم المجال",
776783
"Placeholder_for_password_login_field" : "نائب عن مجال تسجيل الدخول كلمة المرور",
777784
"Please_add_a_comment" : "الرجاء إضافة تعليق",
@@ -1066,6 +1073,7 @@
10661073
"Upload_file_question" : "تحميل الملف؟",
10671074
"Uploading_file" : "تحميل الملف ...",
10681075
"Uptime" : "الجهوزية",
1076+
"URL" : "URL",
10691077
"Use_account_preference" : "استخدم تفضيلات الحساب",
10701078
"Use_Emojis" : "استخدم الرموز التعبيرية (ايموجي)",
10711079
"Use_initials_avatar" : "استخدم الأحرف الأولى من اسم المستخدم",

packages/rocketchat-lib/i18n/ca.i18n.json

+9-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
"Accounts_OAuth_Custom_Secret" : "Secret",
5050
"Accounts_OAuth_Custom_Token_Path" : "Ruta del token",
5151
"Accounts_OAuth_Custom_Token_Sent_Via" : "Token enviat via",
52-
"Accounts_OAuth_Custom_URL" : "URL",
5352
"Accounts_OAuth_Facebook" : "Inici de sessió amb Facebook",
5453
"Accounts_OAuth_Facebook_callback_url" : "URL de retorn (<em>callback</em>) de Facebook",
5554
"Accounts_OAuth_Facebook_id" : "App ID de Facebook",
@@ -127,6 +126,10 @@
127126
"All_messages" : "Tots els missatges",
128127
"Allow_Invalid_SelfSigned_Certs" : "Permetre certificats auto-signats invàlids",
129128
"Allow_Invalid_SelfSigned_Certs_Description" : "Permetre certificats SSL auto-signats i invàlids per a enllaços de validació i vistes prèvies.",
129+
"Analytics_features_enabled" : "característiques habilitades",
130+
"Analytics_features_messages_Description" : "Pistes d'esdeveniments personalitzats relacionats amb accions que un usuari fa en els missatges.",
131+
"Analytics_features_rooms_Description" : "Pistes d'esdeveniments personalitzats relacionats amb accions en un canal o grup (crear, sortir, eliminar).",
132+
"Analytics_features_users_Description" : "Pistes d'esdeveniments personalitzats relacionats amb les accions relacionades amb els usuaris (temps de restabliment de contrasenya, el perfil de canvi d'imatge, etc.).",
130133
"and" : "i",
131134
"And_more" : "I més __length __",
132135
"Animals_and_Nature" : "Animals i natura",
@@ -279,6 +282,7 @@
279282
"Direct_Messages" : "Missatges directes",
280283
"Displays_action_text" : "Mostra text de l'acció",
281284
"Do_you_want_to_change_to_s_question" : "Canvia a <strong>%s</strong>?",
285+
"Domains" : "dominis",
282286
"Drop_to_upload_file" : "Arrossega un arxiu aquí per pujar-lo",
283287
"Dry_run" : "Funcionament de prova",
284288
"Dry_run_description" : "Només s'enviarà un correu-e, a l'adreça del camp \"De\". El correu electrònic ha de pertànyer a un usuari vàlid.",
@@ -388,6 +392,7 @@
388392
"False" : "Fals",
389393
"Favorite_Rooms" : "Habilita sales favorites",
390394
"Favorites" : "Favorits",
395+
"Features_Enabled" : "característiques habilitades",
391396
"Field" : "Camp",
392397
"Field_removed" : "Camp eliminat",
393398
"File_exceeds_allowed_size_of_bytes" : "L'arxiu supera la mida màxima de __size__ bytes",
@@ -772,6 +777,8 @@
772777
"Pin_Message" : "Fixa missatge",
773778
"Pinned_a_message" : "S'ha fixat un missatge:",
774779
"Pinned_Messages" : "Missatges fixats",
780+
"PiwikAnalytics_siteId_Description" : "La Identificació del lloc a utilitzar per a la identificació d'aquest lloc. Exemple: 17",
781+
"PiwikAnalytics_url_Description" : "La URL on resideix el Piwik, assegureu-vos d'incloure la barra provant. Exemple: //piwik.rocket.chat/",
775782
"Placeholder_for_email_or_username_login_field" : "Indicatiu (<em>placeholder</em>) per al camp d'inici de sessió (correu electrònic o nom d'usuari)",
776783
"Placeholder_for_password_login_field" : "Indicatiu (<em>placeholder</em>) per al camp de contrasenya (inici de sessió)",
777784
"Please_add_a_comment" : "Si us plau, afegeix un comentari",
@@ -1066,6 +1073,7 @@
10661073
"Upload_file_question" : "Pujar l'arxiu?",
10671074
"Uploading_file" : "Pujant l'arxiu...",
10681075
"Uptime" : "Temps en funcionament",
1076+
"URL" : "URL",
10691077
"Use_account_preference" : "Utilitza la preferència del compte",
10701078
"Use_Emojis" : "Utilitza emojis",
10711079
"Use_initials_avatar" : "Utilitza les inicials del nom d'usuari",

packages/rocketchat-lib/i18n/cs.i18n.json

+9-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
"Accounts_OAuth_Custom_Secret" : "Secret",
5050
"Accounts_OAuth_Custom_Token_Path" : "Cesta k tokenu",
5151
"Accounts_OAuth_Custom_Token_Sent_Via" : "Token odesílány skrze",
52-
"Accounts_OAuth_Custom_URL" : "URL",
5352
"Accounts_OAuth_Facebook" : "Facebook Přihlášení",
5453
"Accounts_OAuth_Facebook_callback_url" : "Facebook Callback URL",
5554
"Accounts_OAuth_Facebook_id" : "Facebook App Id",
@@ -127,6 +126,10 @@
127126
"All_messages" : "Všechny zprávy",
128127
"Allow_Invalid_SelfSigned_Certs" : "Umožnit nevalidní či self-signed certifikáty",
129128
"Allow_Invalid_SelfSigned_Certs_Description" : "Umožňují použít neplatné/vlastní podepsané SSL certifikáty pro ověření spojení a náhledy.",
129+
"Analytics_features_enabled" : "funkce Povoleno",
130+
"Analytics_features_messages_Description" : "Sleduje vlastní události spojené s akcemi uživatel dělá na zprávy.",
131+
"Analytics_features_rooms_Description" : "Sleduje vlastní události spojené s činností na kanálu nebo skupině (vytvořit, odejít, mazat).",
132+
"Analytics_features_users_Description" : "Sleduje vlastní události spojené s činností souvisejících s uživateli (reset hesla časy, profil Změnit obrázek, atd).",
130133
"and" : "a",
131134
"And_more" : "A další __length __",
132135
"Animals_and_Nature" : "Zvířata & Příroda",
@@ -279,6 +282,7 @@
279282
"Direct_Messages" : "Přímé zprávy",
280283
"Displays_action_text" : "Zobrazuje text akce",
281284
"Do_you_want_to_change_to_s_question" : "Chcete <strong>změnit na %s?</strong>",
285+
"Domains" : "domény",
282286
"Drop_to_upload_file" : "Pusťe soubor do okna pro jeho nahrání",
283287
"Dry_run" : "Zkouška",
284288
"Dry_run_description" : "Odešle pouze jeden e-mail, na stejnou adresu jako ve formuláři. K e-mailu musí patřit platný uživatel.",
@@ -388,6 +392,7 @@
388392
"False" : "Ne",
389393
"Favorite_Rooms" : "Aktivovat oblíbené místnosti",
390394
"Favorites" : "Oblíbené",
395+
"Features_Enabled" : "funkce Povoleno",
391396
"Field" : "Pole",
392397
"Field_removed" : "Pole odebráno",
393398
"File_exceeds_allowed_size_of_bytes" : "Soubor překračuje povolenou velikost __size__ bajtů",
@@ -772,6 +777,8 @@
772777
"Pin_Message" : "Připnout zprávu",
773778
"Pinned_a_message" : "Připnul zprávu:",
774779
"Pinned_Messages" : "Připnuté zprávy",
780+
"PiwikAnalytics_siteId_Description" : "Id webu používat k identifikaci těchto stránek. Příklad: 17",
781+
"PiwikAnalytics_url_Description" : "Url kde Piwik bydliště, nezapomeňte zahrnout trialing lomítko. Příklad: //piwik.rocket.chat/",
775782
"Placeholder_for_email_or_username_login_field" : "Zástupný symbol pro pole e-mailu nebo uživatelského jména v přihlášení",
776783
"Placeholder_for_password_login_field" : "Zástupný symbol pro pole hesla v přihlášení",
777784
"Please_add_a_comment" : "Prosím, přidejte komentář",
@@ -1066,6 +1073,7 @@
10661073
"Upload_file_question" : "Nahrát soubor?",
10671074
"Uploading_file" : "Nahrávání souboru ...",
10681075
"Uptime" : "uptime",
1076+
"URL" : "URL",
10691077
"Use_account_preference" : "Použít nastavení účtu",
10701078
"Use_Emojis" : "Použít emotikony",
10711079
"Use_initials_avatar" : "Použít iniciály",

packages/rocketchat-lib/i18n/de.i18n.json

+9-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
"Accounts_OAuth_Custom_Secret" : "Secret",
5050
"Accounts_OAuth_Custom_Token_Path" : "Pfad des Token",
5151
"Accounts_OAuth_Custom_Token_Sent_Via" : "Token gesendet über",
52-
"Accounts_OAuth_Custom_URL" : "URL",
5352
"Accounts_OAuth_Facebook" : "Anmeldung über Facebook erlauben",
5453
"Accounts_OAuth_Facebook_callback_url" : "Facebook-Callback-URL",
5554
"Accounts_OAuth_Facebook_id" : "Facebook-App-ID",
@@ -127,6 +126,10 @@
127126
"All_messages" : "Alle Nachrichten",
128127
"Allow_Invalid_SelfSigned_Certs" : "Ungültige und selbstsignierte SSL-Zertifikate erlauben",
129128
"Allow_Invalid_SelfSigned_Certs_Description" : "Ungültige und selbstsignierte SSL-Zertifikate für die Link-Validierung und die Vorschau zulassen",
129+
"Analytics_features_enabled" : "Funktionen aktiviert",
130+
"Analytics_features_messages_Description" : "Tracks benutzerdefinierte Ereignisse im Zusammenhang mit Aktionen ein Nutzer auf Nachrichten.",
131+
"Analytics_features_rooms_Description" : "Tracks benutzerdefinierte Ereignisse im Zusammenhang mit Aktionen auf einem Kanal oder einer Gruppe (erstellen, verlassen, löschen).",
132+
"Analytics_features_users_Description" : "Tracks benutzerdefinierte Ereignisse im Zusammenhang mit Maßnahmen im Zusammenhang mit Benutzer (Passwort-Reset-Zeiten, Profilbild ändern, etc).",
130133
"and" : "und",
131134
"And_more" : "Und mehr __length__",
132135
"Animals_and_Nature" : "Tiere & Natur",
@@ -279,6 +282,7 @@
279282
"Direct_Messages" : "Private Nachrichten",
280283
"Displays_action_text" : "Zeigt Aktionstext",
281284
"Do_you_want_to_change_to_s_question" : "Möchten Sie dies zu <strong>%s</strong> ändern?",
285+
"Domains" : "Domains",
282286
"Drop_to_upload_file" : "Ablegen, um Datei hochzuladen",
283287
"Dry_run" : "Probelauf",
284288
"Dry_run_description" : "Es wird nur eine E-Mail an die selbe Adresse wie im Feld Absender geschickt. Die E-Mailadresse muss einem gültigen Benutzer gehören.",
@@ -388,6 +392,7 @@
388392
"False" : "Nein",
389393
"Favorite_Rooms" : "Favorisierte Räume aktivieren",
390394
"Favorites" : "Favoriten",
395+
"Features_Enabled" : "Funktionen aktiviert",
391396
"Field" : "Feld",
392397
"Field_removed" : "Feld entfernt",
393398
"File_exceeds_allowed_size_of_bytes" : "Die Datei ist größer als das erlaubte Maximum von __size__ Bytes",
@@ -772,6 +777,8 @@
772777
"Pin_Message" : "Nachricht fixieren",
773778
"Pinned_a_message" : "hat eine Nachricht angeheftet:",
774779
"Pinned_Messages" : "Fixierte Nachrichten",
780+
"PiwikAnalytics_siteId_Description" : "Die Website-ID zur Identifizierung zur Nutzung dieser Website. Beispiel: 17",
781+
"PiwikAnalytics_url_Description" : "Die URL, wo die Piwik befindet, sollten Sie die trialing slash aufzunehmen. Beispiel: //piwik.rocket.chat/",
775782
"Placeholder_for_email_or_username_login_field" : "Platzhalter für das Feld der E-Mail-Adresse und des Benutzernamen",
776783
"Placeholder_for_password_login_field" : "Platzhalter für das Feld des Anmeldepassworts",
777784
"Please_add_a_comment" : "Bitte fügen Sie einen Kommentar hinzu",
@@ -1066,6 +1073,7 @@
10661073
"Upload_file_question" : "Möchten Sie eine Datei hochladen?",
10671074
"Uploading_file" : "Datei wird hochgeladen...",
10681075
"Uptime" : "Laufzeit",
1076+
"URL" : "URL",
10691077
"Use_account_preference" : "Kontoeinstellungen verwenden",
10701078
"Use_Emojis" : "Emojis verwenden",
10711079
"Use_initials_avatar" : "Anfangsbuchstaben deines Nutzernamens verwenden",

0 commit comments

Comments
 (0)