Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ahtavarasmus/lightfriend
/ functions
Functions
2,907 in github.com/ahtavarasmus/lightfriend
⨍
Functions
2,907
◇
Types & classes
857
↓ 8 callers
Function
array_to_base64url
Convert Uint8Array to base64url string
frontend/src/utils/webauthn.rs:64
↓ 8 callers
Function
auth_app
()
backend/tests/telnyx_handlers_test.rs:187
↓ 8 callers
Method
build
(self)
backend/src/context.rs:206
↓ 8 callers
Function
build_digest_for_user
Build a sectioned digest for a single user. Pure-ish: makes DB queries and one round of async lookups for bridge read receipts, but does not send any
backend/src/jobs/scheduler.rs:1482
↓ 8 callers
Function
capitalize_first
(s: &str)
frontend/src/dashboard/rule_builder.rs:6294
↓ 8 callers
Function
check_secret
Validates the X-Maintenance-Secret header against the MAINTENANCE_SECRET env var.
backend/src/handlers/maintenance_handlers.rs:15
↓ 8 callers
Function
check_user_credits
Checks if a user has sufficient credits to perform an action. For SMS events (message, noti_msg, digest): just checks credits > 0. Actual SMS cost is
backend/src/utils/usage.rs:94
↓ 8 callers
Function
format_timestamp
(timestamp: i64, timezone: Option<String>)
backend/src/utils/bridge.rs:115
↓ 8 callers
Method
get_messages_for_room
Get messages for a specific room, ordered by created_at DESC.
backend/src/repositories/ontology_repository.rs:1151
↓ 8 callers
Method
get_user_settings
(&self, user_id: i32)
backend/src/test_utils.rs:1019
↓ 8 callers
Method
get_vehicle_data
Get vehicle data including charge, climate, and vehicle state
backend/src/api/tesla.rs:315
↓ 8 callers
Function
get_webauthn
Get the global WebAuthn instance
backend/src/utils/webauthn_config.rs:8
↓ 8 callers
Function
has_auto_features
Centralized plan feature helpers. All plan_type gating should go through these two functions. If tier names change in the future, only this file need
backend/src/utils/plan_features.rs:8
↓ 8 callers
Method
record_telnyx_delivery_fallback_error
( &self, message_sid: &str, error: &str, )
backend/src/repositories/twilio_status_repository_impl.rs:108
↓ 8 callers
Method
reserve_idempotency_key
Look up an idempotency key, reserving a fresh row if the key is unseen. The whole sequence runs in a transaction so concurrent requests with the same
backend/src/repositories/webhook_tokens_repository.rs:229
↓ 8 callers
Function
search_bridge_rooms
( service: &str, state: &Arc<AppState>, user_id: i32, search_term: &str, )
backend/src/utils/bridge.rs:3008
↓ 8 callers
Method
set_route
Replace the in-memory routing order for a country. Called once per row at startup from `main.rs` after loading `provider_routes`, and again from the a
backend/src/channels/router.rs:62
↓ 8 callers
Function
setup_test_encryption
Set up test encryption key (call once before BYOT tests)
backend/src/test_utils.rs:612
↓ 7 callers
Function
auth_app
()
backend/tests/sinch_handlers_test.rs:130
↓ 7 callers
Method
build_query_tools
Build one tool definition per entity type, injecting user-specific enum values.
backend/src/ontology/registry.rs:141
↓ 7 callers
Method
chat_completion_with_fallback
( &self, usage_repo: Option<&Arc<crate::repositories::llm_usage_repository::LlmUsageRepository
backend/src/ai_config.rs:340
↓ 7 callers
Function
clamp_sms_body
Clamp a body to the provider-safe SMS request size while preserving UTF-8 boundaries and making the truncation visible to the recipient.
backend/src/utils/sms_sanitizer.rs:71
↓ 7 callers
Function
compare_optional
(label: &str, live: &Option<String>, build: &Option<String>)
tools/attestation-verifier/src/main.rs:174
↓ 7 callers
Method
create_bridge
(&self, new_bridge: NewPgBridge)
backend/src/repositories/user_repository.rs:1240
↓ 7 callers
Function
create_test_message
(message_sid: &str, status: &str)
backend/tests/twilio_status_service_test.rs:17
↓ 7 callers
Method
dispatch_sms
Twilio-specific SMS dispatch. Assumes preprocessing (URL filter, empty-body guard, message-history logging, dev-mode skip) has already run at the prov
backend/src/services/twilio_message_service.rs:281
↓ 7 callers
Function
fetch_bridge_messages
( service: &str, state: &Arc<AppState>, user_id: i32, start_time: i64, _unread_only: bool,
backend/src/utils/bridge.rs:1087
↓ 7 callers
Method
get_all_users
(&self)
backend/src/repositories/user_core.rs:360
↓ 7 callers
Method
get_events_due_for_friend_notification
Events whose deadline is inside the accountability grace window (now >= due_at - grace_secs, still before due_at) and which haven't already triggered
backend/src/repositories/ontology_repository.rs:2267
↓ 7 callers
Method
get_max_processed_uid
Return the highest numeric `email_uid` value in `processed_emails` for a given (user_id, imap_connection_id). Used by the IDLE loop to resync mail tha
backend/src/repositories/user_repository.rs:397
↓ 7 callers
Method
get_message_by_email_room_id
Look up an existing email-sourced message by its deterministic `email_<uid>` room_id. Used by the IDLE path (and cron) to avoid inserting the same ema
backend/src/repositories/ontology_repository.rs:1137
↓ 7 callers
Function
get_resend_config
Get Resend client, from email, and reply-to email from environment. Returns None if RESEND_API_KEY is not set (email sending is optional).
backend/src/utils/email.rs:42
↓ 7 callers
Function
get_sender_prefix
(service: &str)
backend/src/utils/bridge.rs:141
↓ 7 callers
Method
get_tesla_region
(&self, user_id: i32)
backend/src/repositories/user_repository.rs:1054
↓ 7 callers
Method
get_twilio_credentials
Get Twilio credentials from PG `user_secrets` table.
backend/src/repositories/user_repository.rs:1580
↓ 7 callers
Function
get_valid_tesla_access_token
Helper function to get valid Tesla access token (with auto-refresh)
backend/src/handlers/tesla_auth.rs:648
↓ 7 callers
Method
mark_messages_seen_in_room
Mark messages in a room as seen (user read them on the native platform). Sets seen_at on all messages with created_at <= seen_up_to_ts that haven't be
backend/src/repositories/ontology_repository.rs:1920
↓ 7 callers
Function
mint
Helper: insert a token with the given cap and return (raw, row).
backend/tests/webhook_sms_test.rs:34
↓ 7 callers
Function
open_imap_session
Open an authenticated IMAP session over TLS. This is the canonical async path used by all IMAP entry points in this crate. Layered timeouts: `tokio::
backend/src/handlers/imap_handlers.rs:50
↓ 7 callers
Function
param_str
(params: &serde_json::Value, key: &str)
backend/src/tools/ontology.rs:358
↓ 7 callers
Method
set_person_edit
Upsert a person edit (user override).
backend/src/repositories/ontology_repository.rs:518
↓ 7 callers
Function
stop_matrix_user_if_no_bridges
Tear down the Matrix client and sync loop for `user_id`, but only if they have no remaining connected bridges. Call this from bridge disconnect flows
backend/src/utils/matrix_auth.rs:891
↓ 7 callers
Method
update_critical_enabled
( &self, _user_id: i32, _enabled: Option<String>, )
backend/src/test_utils.rs:1247
↓ 7 callers
Method
update_digest_enabled
(&self, _user_id: i32, _value: bool)
backend/src/test_utils.rs:1133
↓ 7 callers
Method
update_preferred_number
( &self, user_id: i32, preferred_number: &str, )
backend/src/repositories/user_core.rs:733
↓ 7 callers
Method
update_user_credits
Credits management
backend/src/repositories/user_subscriptions.rs:32
↓ 7 callers
Method
update_user_credits_left
( &self, user_id: i32, new_credits_left: f32, )
backend/src/repositories/user_subscriptions.rs:40
↓ 7 callers
Method
upsert_person
Find-or-create a Person + Channel. Returns the Person. Used by bridge.rs for auto-creation on first message from recognized phone contacts.
backend/src/repositories/ontology_repository.rs:207
↓ 6 callers
Function
compute_twilio_signature
Pure function: compute the Twilio signature for a given URL+params+token. Useful for tests.
backend/src/api/twilio_utils.rs:74
↓ 6 callers
Method
connection
(&self)
backend/src/repositories/tuwunel_cleanup_repository.rs:190
↓ 6 callers
Function
create_llm_test_state
Create an AppState with real LLM credentials (loads from .env)
backend/tests/llm_integration_test.rs:26
↓ 6 callers
Function
create_test_rooms
()
backend/tests/bridge_test.rs:330
↓ 6 callers
Method
create_user
( &self, new_user: crate::handlers::auth_dtos::NewUser, )
backend/src/test_utils.rs:895
↓ 6 callers
Method
delete_message_by_matrix_event_id
Delete the `ont_messages` row matching `(user_id, matrix_event_id)`. Returns the number of rows deleted (0 = no matching row, 1 = matched). Called by
backend/src/repositories/ontology_repository.rs:1116
↓ 6 callers
Method
determine_sending_strategy
Determine the sending strategy for a user (From number vs Messaging Service). Returns (from_number, use_messaging_service, should_update_preferred).
backend/src/services/twilio_message_service.rs:129
↓ 6 callers
Method
ensure_user_info_exists
Helper function to ensure user_info exists (PG)
backend/src/repositories/user_core.rs:468
↓ 6 callers
Method
find_by_email
(&self, search_email: &str)
backend/src/repositories/user_core.rs:285
↓ 6 callers
Function
find_exact_room
(bridge_rooms: &[BridgeRoom], search_term: &str)
backend/src/utils/bridge.rs:624
↓ 6 callers
Function
fresh_keypair
Build (signing_key, base64_public_key) for a fresh test keypair.
backend/tests/telnyx_handlers_test.rs:194
↓ 6 callers
Function
generate_tokens_and_response
( state: &Arc<AppState>, user_id: i32, )
backend/src/handlers/auth_handlers.rs:657
↓ 6 callers
Function
get_country_name
(code: &str)
backend/src/handlers/pricing_handlers.rs:134
↓ 6 callers
Method
get_credentials_by_user
Get all credentials for a user
backend/src/repositories/webauthn_repository.rs:70
↓ 6 callers
Method
get_message
Get a message from the mock repository.
backend/src/repositories/mock_twilio_status_repository.rs:63
↓ 6 callers
Method
get_person_with_channels
Get a single Person with Channels and edits.
backend/src/repositories/ontology_repository.rs:477
↓ 6 callers
Function
get_service_rooms
(client: &MatrixClient, service: &str)
backend/src/utils/bridge.rs:328
↓ 6 callers
Method
get_stripe_customer_id
Stripe related methods
backend/src/repositories/user_subscriptions.rs:102
↓ 6 callers
Method
is_totp_enabled
Check if TOTP is enabled for a user
backend/src/repositories/totp_repository.rs:82
↓ 6 callers
Function
log_ok
(msg: str)
scripts/imap_idle_stress.py:78
↓ 6 callers
Function
log_warn
(msg: str)
scripts/imap_idle_stress.py:82
↓ 6 callers
Function
make_callback_params
()
backend/tests/twilio_handlers_test.rs:217
↓ 6 callers
Method
mark_email_as_processed
Mark an email as processed
backend/src/repositories/user_repository.rs:1748
↓ 6 callers
Function
now_timestamp
()
backend/src/repositories/tuwunel_cleanup_repository.rs:197
↓ 6 callers
Function
parse_list_logins
Parse a full bridgev2 `list-logins` body into a vec of entries. Unknown lines (help text, errors) are skipped; only lines that match the verified form
backend/src/utils/bridge_responses.rs:191
↓ 6 callers
Function
release_idempotency
Best-effort cleanup of an in-flight idempotency row when the request fails before completing. Errors are logged but not propagated — the row will natu
backend/src/handlers/webhook_sms_handlers.rs:479
↓ 6 callers
Function
rule
(trigger_config: serde_json::Value)
backend/tests/group_attention_gate_test.rs:6
↓ 6 callers
Method
send_command_with_body
Generic command sender with JSON body
backend/src/api/tesla.rs:662
↓ 6 callers
Function
send_message
Send a message through the full SMS processing pipeline (with real LLM, no Twilio send)
backend/tests/llm_integration_test.rs:65
↓ 6 callers
Method
send_message
Send a text message to a room
backend/src/test_utils/matrix_test_server.rs:256
↓ 6 callers
Method
set_cabin_overheat_protection
Set cabin overheat protection on/off
backend/src/api/tesla.rs:487
↓ 6 callers
Function
setup_user_with_location
Create a test user with location, timezone, and autopilot plan set. Autopilot is needed so tracking items pass the plan gate.
backend/tests/llm_integration_test.rs:38
↓ 6 callers
Function
step
Run one step of the purge: push a Running entry, run the future, then update the entry to Done / Failed based on the result. On failure the error is a
backend/src/services/data_purge.rs:214
↓ 6 callers
Method
update_notify
Update user's notify preference in user_settings
backend/src/repositories/user_core.rs:1140
↓ 5 callers
Function
apply_sms_url_filter
Sanitize a message body for A2P 10DLC delivery. Two passes: 1. Re-fang defanged emails and domains (e.g. `user[.]name(at)example[.]com` → `user.name@
backend/src/utils/sms_sanitizer.rs:64
↓ 5 callers
Function
assert_no_item
Assert that NO item was created (question/realtime request)
backend/tests/llm_integration_test.rs:124
↓ 5 callers
Function
base64url_to_array
Convert a base64url string to Uint8Array
frontend/src/utils/webauthn.rs:37
↓ 5 callers
Method
claim_send_slot
Atomically reserve one send slot. Resets the daily window when the stored `daily_reset_at` is in the past, then increments `daily_sent` only if it wou
backend/src/repositories/webhook_tokens_repository.rs:140
↓ 5 callers
Function
classify_whatsapp_start_chat
Strict classifier for `!wa start-chat` reply bodies. Returns `None` for unrecognized bodies; caller must NOT treat that as a success or a failure — o
backend/src/utils/bridge_responses.rs:359
↓ 5 callers
Function
clean_url
()
frontend/src/pages/home.rs:451
↓ 5 callers
Method
count_usage_activities_since
( &self, user_id: i32, since_ts: i32, activity_types: &[&str], )
backend/src/repositories/user_repository.rs:544
↓ 5 callers
Method
create_room
Create a room
backend/src/test_utils/matrix_test_server.rs:195
↓ 5 callers
Function
decode_rfc2047
Decode RFC 2047 MIME encoded words (e.g. =?UTF-8?Q?...?=) in header values. Uses mail_parser for correct handling of all charset/encoding variants.
backend/src/handlers/imap_handlers.rs:23
↓ 5 callers
Method
delete_message
( &self, credentials: &TwilioCredentials, message_sid: &str, )
backend/src/api/twilio_client.rs:369
↓ 5 callers
Function
empty_user_data
()
backend/tests/ontology_registry_test.rs:9
↓ 5 callers
Function
ensure_matrix_user_running
Ensure the Matrix client, event handlers, and sync loop are running for `user_id`. This is the single entry point for acquiring a Matrix client. Idemp
backend/src/utils/matrix_auth.rs:818
↓ 5 callers
Method
fetch_message_price
Fetch the price of a sent message.
backend/src/services/twilio_message_service.rs:553
↓ 5 callers
Method
find_by_stripe_customer_id
( &self, customer_id: &str, )
backend/src/repositories/user_subscriptions.rs:147
↓ 5 callers
Function
first_connected_identifier
Convenience: identifier (usually phone number) of the first CONNECTED login. The identifier is the value inside parentheses in the `list-logins` line
backend/src/utils/bridge_responses.rs:281
↓ 5 callers
Method
get_login_phone_for_matrix_user
Look up the WhatsApp phone number that a Matrix user is logged into the bridge as. Returns Ok(None) if the user is not currently logged in. Note: thi
backend/src/repositories/whatsapp_bridge_repository.rs:142
↓ 5 callers
Function
get_notification_only_pricing
Get pricing for a country with segment-based multipliers. This fetches pricing from Twilio (with 24h cache) and applies segment-based formulas: - Not
backend/src/api/twilio_pricing.rs:68
↓ 5 callers
Method
get_persons
Get all Persons for a user.
backend/src/repositories/ontology_repository.rs:413
← previous
next →
101–200 of 2,907, ranked by callers